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 Details

    • init

      default Either<Exception,UnaryOperator<ClusterConfiguration>> init(ClusterConfiguration currentClusterConfiguration)
      Description copied from interface: ConfigurationChangeAppliers.ClusterOperationApplier
      This method will be called before invoking ConfigurationChangeAppliers.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:
      init in interface ConfigurationChangeAppliers.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.ClusterOperationApplier
      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 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:
      apply in interface ConfigurationChangeAppliers.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 invoking 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.
      Returns:
      an either which contains an exception if the operation is not valid, or a function to update the cluster configuration
    • 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.