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.

  • Constructor Details

    • RoutingState

      public RoutingState(long version, Set<Integer> activePartitions, RoutingState.MessageCorrelation messageCorrelation)
      Creates an instance of a RoutingState record class.
      Parameters:
      version - the value for the version record component
      activePartitions - the value for the activePartitions record component
      messageCorrelation - the value for the messageCorrelation record component
  • Method Details

    • merge

      public RoutingState merge(RoutingState other)
    • initializeWithPartitionCount

      public static RoutingState initializeWithPartitionCount(int partitionCount)
      Returns the initial routing info for the given partition count when all partitions participate in message correlation.
    • 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 '=='.
      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.
    • version

      public long version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • activePartitions

      public Set<Integer> activePartitions()
      Returns the value of the activePartitions record component.
      Returns:
      the value of the activePartitions record component
    • messageCorrelation

      public RoutingState.MessageCorrelation messageCorrelation()
      Returns the value of the messageCorrelation record component.
      Returns:
      the value of the messageCorrelation record component