Interface ConfigurationChangeAppliers.MemberOperationApplier
- All Superinterfaces:
ConfigurationChangeAppliers.ClusterOperationApplier
- All Known Implementing Classes:
MemberLeaveApplier,NoopConfigurationChangeAppliers.NoopApplier,PartitionBootstrapApplier,PartitionReconfigurePriorityApplier
- Enclosing interface:
ConfigurationChangeAppliers
public static interface ConfigurationChangeAppliers.MemberOperationApplier
extends ConfigurationChangeAppliers.ClusterOperationApplier
An operation applier that can apply an operation and changes the MemberState of the member that
is applying the operation.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ActorFuture<UnaryOperator<ClusterConfiguration>> apply()Applies the operation.Applies the operation.default Either<Exception, UnaryOperator<ClusterConfiguration>> init(ClusterConfiguration currentClusterConfiguration) This method will be called before invokingConfigurationChangeAppliers.ClusterOperationApplier.apply().initMemberState(ClusterConfiguration currentClusterConfiguration) This method will be called before invokingapplyOperation().memberId()
-
Method Details
-
init
default Either<Exception,UnaryOperator<ClusterConfiguration>> init(ClusterConfiguration currentClusterConfiguration) Description copied from interface:ConfigurationChangeAppliers.ClusterOperationApplierThis method will be called before invokingConfigurationChangeAppliers.ClusterOperationApplier.apply(). 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:
initin interfaceConfigurationChangeAppliers.ClusterOperationApplier- Returns:
- an either which contains an exception if the operation is not valid, or a function to update the cluster configuration
-
apply
Description copied from interface:ConfigurationChangeAppliers.ClusterOperationApplierApplies 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 ClusterConfiguration 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 ClusterConfiguration updated by
ClusterConfiguration.init()remains the same until this operation is completed.- Specified by:
applyin interfaceConfigurationChangeAppliers.ClusterOperationApplier- Returns:
- the future which is completed when the operation is completed successfully or failed.
-
memberId
MemberId memberId() -
initMemberState
Either<Exception,UnaryOperator<MemberState>> initMemberState(ClusterConfiguration currentClusterConfiguration) This method will be called before invokingapplyOperation(). 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.- Returns:
- an either which contains an exception if the operation is not valid, or a function to update the cluster configuration
-
applyOperation
ActorFuture<UnaryOperator<MemberState>> applyOperation()Applies 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
initMemberState(ClusterConfiguration)remains the same until this operation is completed.- Returns:
- the future which is completed when the operation is completed successfully or failed.
-