Record Class CrdbConfig
java.lang.Object
java.lang.Record
com.cockroachlabs.crdb.config.CrdbConfig
- Record Components:
retry- retry policy for serialization anomaliescircuitFailureThreshold- consecutive failures before a breaker openscircuitResetMillis- how long a breaker stays open before HALF_OPENdefaultIsolation- default transaction isolation level
public record CrdbConfig(RetryPolicy retry, int circuitFailureThreshold, long circuitResetMillis, Isolation defaultIsolation)
extends Record
Immutable library configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionCrdbConfig(RetryPolicy retry, int circuitFailureThreshold, long circuitResetMillis, Isolation defaultIsolation) Creates an instance of aCrdbConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecircuitFailureThresholdrecord component.longReturns the value of thecircuitResetMillisrecord component.Returns the value of thedefaultIsolationrecord component.static CrdbConfigdefaults()Sensible defaults for all settings.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.retry()Returns the value of theretryrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CrdbConfig
public CrdbConfig(RetryPolicy retry, int circuitFailureThreshold, long circuitResetMillis, Isolation defaultIsolation) Creates an instance of aCrdbConfigrecord class.- Parameters:
retry- the value for theretryrecord componentcircuitFailureThreshold- the value for thecircuitFailureThresholdrecord componentcircuitResetMillis- the value for thecircuitResetMillisrecord componentdefaultIsolation- the value for thedefaultIsolationrecord component
-
-
Method Details
-
defaults
Sensible defaults for all settings. -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
retry
-
circuitFailureThreshold
public int circuitFailureThreshold()Returns the value of thecircuitFailureThresholdrecord component.- Returns:
- the value of the
circuitFailureThresholdrecord component
-
circuitResetMillis
public long circuitResetMillis()Returns the value of thecircuitResetMillisrecord component.- Returns:
- the value of the
circuitResetMillisrecord component
-
defaultIsolation
Returns the value of thedefaultIsolationrecord component.- Returns:
- the value of the
defaultIsolationrecord component
-