Record Class ClusterChangePlan

java.lang.Object
java.lang.Record
io.camunda.zeebe.dynamic.config.state.ClusterChangePlan

public record ClusterChangePlan(long id, int version, ClusterChangePlan.Status status, Instant startedAt, List<ClusterChangePlan.CompletedOperation> completedOperations, List<ClusterConfigurationChangeOperation> pendingOperations) extends Record
Represents the ongoing cluster configuration changes. The pendingOperations are executed sequentially. Only after completing one operation, the next operation is started. Once an operation is completed, it should be removed from the plan, so that the next operation can be picked up.

version starts at 1 and increments every time an operation is completed and removed from the pending operations. This helps to choose the latest state of the configuration change when receiving gossip update out of order.

  • Constructor Details

    • ClusterChangePlan

      public ClusterChangePlan(long id, int version, ClusterChangePlan.Status status, Instant startedAt, List<ClusterChangePlan.CompletedOperation> completedOperations, List<ClusterConfigurationChangeOperation> pendingOperations)
      Creates an instance of a ClusterChangePlan record class.
      Parameters:
      id - the value for the id record component
      version - the value for the version record component
      status - the value for the status record component
      startedAt - the value for the startedAt record component
      completedOperations - the value for the completedOperations record component
      pendingOperations - the value for the pendingOperations record component
  • Method Details

    • init

      public static ClusterChangePlan init(long id, List<ClusterConfigurationChangeOperation> operations)
    • merge

      public ClusterChangePlan merge(ClusterChangePlan other)
    • hasPendingChangesFor

      public boolean hasPendingChangesFor(MemberId memberId)
    • nextPendingOperation

      public ClusterConfigurationChangeOperation nextPendingOperation()
    • hasPendingChanges

      public boolean hasPendingChanges()
    • cancel

      public CompletedChange cancel()
    • 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.
    • id

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

      public int version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • status

      public ClusterChangePlan.Status status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • startedAt

      public Instant startedAt()
      Returns the value of the startedAt record component.
      Returns:
      the value of the startedAt record component
    • completedOperations

      public List<ClusterChangePlan.CompletedOperation> completedOperations()
      Returns the value of the completedOperations record component.
      Returns:
      the value of the completedOperations record component
    • pendingOperations

      public List<ClusterConfigurationChangeOperation> pendingOperations()
      Returns the value of the pendingOperations record component.
      Returns:
      the value of the pendingOperations record component