Record Class CrdbContextValues
java.lang.Object
java.lang.Record
com.cockroachlabs.crdb.context.CrdbContextValues
- Record Components:
region- the region to pin execution tovirtualCluster- the Cockroach vCluster to route toworkload- the workload priority classfollowerReadStaleness- the follower-read staleness expression, if any
public record CrdbContextValues(String region, String virtualCluster, Workload.Priority workload, String followerReadStaleness)
extends Record
Immutable bundle of CockroachDB call context. Any field may be
null
meaning "unset".-
Constructor Summary
ConstructorsConstructorDescriptionCrdbContextValues(String region, String virtualCluster, Workload.Priority workload, String followerReadStaleness) Creates an instance of aCrdbContextValuesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CrdbContextValuesempty()The empty context (all fields unset).final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefollowerReadStalenessrecord component.final inthashCode()Returns a hash code value for this object.merge(CrdbContextValues other) Overlayotheronto this one: any non-null field ofotherwins, otherwise this value is retained.region()Returns the value of theregionrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevirtualClusterrecord component.withRegion(String r) workload()Returns the value of theworkloadrecord component.
-
Constructor Details
-
CrdbContextValues
public CrdbContextValues(String region, String virtualCluster, Workload.Priority workload, String followerReadStaleness) Creates an instance of aCrdbContextValuesrecord class.- Parameters:
region- the value for theregionrecord componentvirtualCluster- the value for thevirtualClusterrecord componentworkload- the value for theworkloadrecord componentfollowerReadStaleness- the value for thefollowerReadStalenessrecord component
-
-
Method Details
-
empty
The empty context (all fields unset). -
withRegion
-
withVirtualCluster
-
withWorkload
-
withFollowerReadStaleness
-
merge
Overlayotheronto this one: any non-null field ofotherwins, otherwise this value is retained. Lets nested scopes refine parent context without wiping it. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
region
-
virtualCluster
Returns the value of thevirtualClusterrecord component.- Returns:
- the value of the
virtualClusterrecord component
-
workload
-
followerReadStaleness
Returns the value of thefollowerReadStalenessrecord component.- Returns:
- the value of the
followerReadStalenessrecord component
-