Record Class CrdbConfig

java.lang.Object
java.lang.Record
com.cockroachlabs.crdb.config.CrdbConfig
Record Components:
retry - retry policy for serialization anomalies
circuitFailureThreshold - consecutive failures before a breaker opens
circuitResetMillis - how long a breaker stays open before HALF_OPEN
defaultIsolation - default transaction isolation level

public record CrdbConfig(RetryPolicy retry, int circuitFailureThreshold, long circuitResetMillis, Isolation defaultIsolation) extends Record
Immutable library configuration.
  • Constructor Details

    • CrdbConfig

      public CrdbConfig(RetryPolicy retry, int circuitFailureThreshold, long circuitResetMillis, Isolation defaultIsolation)
      Creates an instance of a CrdbConfig record class.
      Parameters:
      retry - the value for the retry record component
      circuitFailureThreshold - the value for the circuitFailureThreshold record component
      circuitResetMillis - the value for the circuitResetMillis record component
      defaultIsolation - the value for the defaultIsolation record component
  • Method Details

    • defaults

      public static CrdbConfig defaults()
      Sensible defaults for all settings.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • retry

      public RetryPolicy retry()
      Returns the value of the retry record component.
      Returns:
      the value of the retry record component
    • circuitFailureThreshold

      public int circuitFailureThreshold()
      Returns the value of the circuitFailureThreshold record component.
      Returns:
      the value of the circuitFailureThreshold record component
    • circuitResetMillis

      public long circuitResetMillis()
      Returns the value of the circuitResetMillis record component.
      Returns:
      the value of the circuitResetMillis record component
    • defaultIsolation

      public Isolation defaultIsolation()
      Returns the value of the defaultIsolation record component.
      Returns:
      the value of the defaultIsolation record component