Record Class RoutingState
java.lang.Object
java.lang.Record
io.camunda.zeebe.dynamic.config.state.RoutingState
public record RoutingState(long version, Set<Integer> activePartitions, RoutingState.MessageCorrelation messageCorrelation)
extends Record
Holds information about the state of partitions that is necessary to decide where to route new
requests.
The version is incremented by the coordinator, every time the routing state changes. This is used to resolve conflicts when the members receive gossip updates out of order.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceStrategy used to correlate messages via their correlation key to partitions. -
Constructor Summary
ConstructorsConstructorDescriptionRoutingState(long version, Set<Integer> activePartitions, RoutingState.MessageCorrelation messageCorrelation) Creates an instance of aRoutingStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactivePartitionsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static RoutingStateinitializeWithPartitionCount(int partitionCount) Returns the initial routing info for the given partition count when all partitions participate in message correlation.merge(RoutingState other) Returns the value of themessageCorrelationrecord component.final StringtoString()Returns a string representation of this record class.longversion()Returns the value of theversionrecord component.
-
Constructor Details
-
RoutingState
public RoutingState(long version, Set<Integer> activePartitions, RoutingState.MessageCorrelation messageCorrelation) Creates an instance of aRoutingStaterecord class.- Parameters:
version- the value for theversionrecord componentactivePartitions- the value for theactivePartitionsrecord componentmessageCorrelation- the value for themessageCorrelationrecord component
-
-
Method Details
-
merge
-
initializeWithPartitionCount
Returns the initial routing info for the given partition count when all partitions participate in message correlation. -
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. -
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. -
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 '=='. -
version
public long version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
activePartitions
Returns the value of theactivePartitionsrecord component.- Returns:
- the value of the
activePartitionsrecord component
-
messageCorrelation
Returns the value of themessageCorrelationrecord component.- Returns:
- the value of the
messageCorrelationrecord component
-