Class PartitionBootstrapApplier
java.lang.Object
io.camunda.zeebe.dynamic.config.changes.PartitionBootstrapApplier
- All Implemented Interfaces:
ConfigurationChangeAppliers.ClusterOperationApplier,ConfigurationChangeAppliers.MemberOperationApplier
public class PartitionBootstrapApplier
extends Object
implements ConfigurationChangeAppliers.MemberOperationApplier
-
Constructor Summary
ConstructorsConstructorDescriptionPartitionBootstrapApplier(int partitionId, int priority, MemberId memberId, PartitionChangeExecutor partitionChangeExecutor) -
Method Summary
Modifier and TypeMethodDescriptionApplies the operation.initMemberState(ClusterConfiguration currentClusterConfiguration) This method will be called before invokingConfigurationChangeAppliers.MemberOperationApplier.applyOperation().memberId()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.zeebe.dynamic.config.changes.ConfigurationChangeAppliers.MemberOperationApplier
apply, init
-
Constructor Details
-
PartitionBootstrapApplier
public PartitionBootstrapApplier(int partitionId, int priority, MemberId memberId, PartitionChangeExecutor partitionChangeExecutor)
-
-
Method Details
-
memberId
- Specified by:
memberIdin interfaceConfigurationChangeAppliers.MemberOperationApplier
-
initMemberState
public Either<Exception,UnaryOperator<MemberState>> initMemberState(ClusterConfiguration currentClusterConfiguration) Description copied from interface:ConfigurationChangeAppliers.MemberOperationApplierThis method will be called before invokingConfigurationChangeAppliers.MemberOperationApplier.applyOperation(). This method can be used to validate the operation and to update the ClusterConfiguration to mark the start of the operation. For example, an operation for joining a partition can mark the state as JOINING.- Specified by:
initMemberStatein interfaceConfigurationChangeAppliers.MemberOperationApplier- Returns:
- an either which contains an exception if the operation is not valid, or a function to update the cluster configuration
-
applyOperation
Description copied from interface:ConfigurationChangeAppliers.MemberOperationApplierApplies the operation. This can be run asynchronously and should complete the future when the operation is completed. The future should be completed with a function that can update the ClusterTopology to mark the operation as completed. For example, an operation for joining a partition should mark the state of the partition as ACTIVE.It is expected that no other operation is applied until this operation is completed. It is guaranteed that the MemberState updated by
ConfigurationChangeAppliers.MemberOperationApplier.initMemberState(ClusterConfiguration)remains the same until this operation is completed.- Specified by:
applyOperationin interfaceConfigurationChangeAppliers.MemberOperationApplier- Returns:
- the future which is completed when the operation is completed successfully or failed.
-