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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionClusterChangePlan(long id, int version, ClusterChangePlan.Status status, Instant startedAt, List<ClusterChangePlan.CompletedOperation> completedOperations, List<ClusterConfigurationChangeOperation> pendingOperations) Creates an instance of aClusterChangePlanrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncancel()Returns the value of thecompletedOperationsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanbooleanhasPendingChangesFor(MemberId memberId) longid()Returns the value of theidrecord component.static ClusterChangePlaninit(long id, List<ClusterConfigurationChangeOperation> operations) merge(ClusterChangePlan other) Returns the value of thependingOperationsrecord component.Returns the value of thestartedAtrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.intversion()Returns the value of theversionrecord component.
-
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 aClusterChangePlanrecord class.- Parameters:
id- the value for theidrecord componentversion- the value for theversionrecord componentstatus- the value for thestatusrecord componentstartedAt- the value for thestartedAtrecord componentcompletedOperations- the value for thecompletedOperationsrecord componentpendingOperations- the value for thependingOperationsrecord component
-
-
Method Details
-
init
-
merge
-
hasPendingChangesFor
-
nextPendingOperation
-
hasPendingChanges
public boolean hasPendingChanges() -
cancel
-
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 '=='. -
id
public long id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
version
public int version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
startedAt
Returns the value of thestartedAtrecord component.- Returns:
- the value of the
startedAtrecord component
-
completedOperations
Returns the value of thecompletedOperationsrecord component.- Returns:
- the value of the
completedOperationsrecord component
-
pendingOperations
Returns the value of thependingOperationsrecord component.- Returns:
- the value of the
pendingOperationsrecord component
-