Interface PartitionChangeExecutor

All Known Implementing Classes:
NoopPartitionChangeExecutor

public interface PartitionChangeExecutor
Represents the executor that executes the actual process to start or start. The concrete implementation of this interface is expected to be a call back to the system component that can start or stop partition. This is typically the PartitionManager in the Broker.
  • Method Details

    • join

      ActorFuture<Void> join(int partitionId, Map<MemberId,Integer> membersWithPriority, DynamicPartitionConfig partitionConfig)
      The implementation of this method must start the partition on this member. The partition must join the replication group formed by the members given in the membersWithPriority. The implementation must be idempotent. If the node restarts after this method was called, but before marking the operation as completed, it will be retried after the restart.
      Parameters:
      partitionId - id of the partition
      membersWithPriority - priority of each replicas used of leader election
      Returns:
      a future that completes when the partition is started and joined the replication group
    • leave

      ActorFuture<Void> leave(int partitionId)
      The implementation of this method must remove the member from the replication group of the given partition and stops the partition on this member. The implementation must be idempotent. If the node restarts after this method was called, but before marking the operation as completed, it will be retried after the restart.
      Parameters:
      partitionId - id of the partition
      Returns:
      a future that completes when the partition is stopped and removed from the replication.
    • bootstrap

      ActorFuture<Void> bootstrap(int partitionId, int priority, DynamicPartitionConfig partitionConfig)
      The implementation of this method must bootstrap the partition with a single replica. The implementation must be idempotent. If the node restarts after this method was called, but before marking the operation as completed, it will be retried after the restart.
      Parameters:
      partitionId - id of the partition
      priority - priority of the member in the partition used for Raft's priority election
      partitionConfig - the configuration of the partition
      Returns:
      a future that completes when the partition is bootstrapped
    • reconfigurePriority

      ActorFuture<Void> reconfigurePriority(int partitionId, int newPriority)
      Updates the priority of the member used for raft priority election for the given partition.
      Parameters:
      partitionId - id of the partition
      newPriority - new priority value
      Returns:
      a future that completes when the priority is updated
    • forceReconfigure

      ActorFuture<Void> forceReconfigure(int partitionId, Collection<MemberId> members)
      Force reconfigure a partition to include only the given members in the replication group.
      Parameters:
      partitionId - id of the partition
      members - members that will be part of the replication group after reconfiguring
      Returns:
      a future that completes when the partition is reconfigured
    • disableExporter

      ActorFuture<Void> disableExporter(int partitionId, String exporterId)
      Disables the exporter for the given partition.
      Parameters:
      partitionId - id of the partition
      exporterId - id of the exporter to disable
      Returns:
      a future that completes when the exporter is disabled
    • enableExporter

      ActorFuture<Void> enableExporter(int partitionId, String exporterId, long metadataVersion, String initializeFrom)
      Enables the exporter for the given partition.
      Parameters:
      partitionId - id of the partition
      exporterId - id of the exporter to enable
      metadataVersion - the version of the metadata to set in the exporter state
      initializeFrom - the id of another exporter to initialize metadata from. Can be null.
      Returns:
      a future that completes when the exporter is enabled