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 Summary
Modifier and TypeMethodDescriptionbootstrap(int partitionId, int priority, DynamicPartitionConfig partitionConfig) The implementation of this method must bootstrap the partition with a single replica.disableExporter(int partitionId, String exporterId) Disables the exporter for the given partition.enableExporter(int partitionId, String exporterId, long metadataVersion, String initializeFrom) Enables the exporter for the given partition.forceReconfigure(int partitionId, Collection<MemberId> members) Force reconfigure a partition to include only the given members in the replication group.join(int partitionId, Map<MemberId, Integer> membersWithPriority, DynamicPartitionConfig partitionConfig) The implementation of this method must start the partition on this member.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.reconfigurePriority(int partitionId, int newPriority) Updates the priority of the member used for raft priority election for the given partition.
-
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 themembersWithPriority. 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 partitionmembersWithPriority- priority of each replicas used of leader election- Returns:
- a future that completes when the partition is started and joined the replication group
-
leave
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
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 partitionpriority- priority of the member in the partition used for Raft's priority electionpartitionConfig- the configuration of the partition- Returns:
- a future that completes when the partition is bootstrapped
-
reconfigurePriority
Updates the priority of the member used for raft priority election for the given partition.- Parameters:
partitionId- id of the partitionnewPriority- new priority value- Returns:
- a future that completes when the priority is updated
-
forceReconfigure
Force reconfigure a partition to include only the given members in the replication group.- Parameters:
partitionId- id of the partitionmembers- members that will be part of the replication group after reconfiguring- Returns:
- a future that completes when the partition is reconfigured
-
disableExporter
Disables the exporter for the given partition.- Parameters:
partitionId- id of the partitionexporterId- 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 partitionexporterId- id of the exporter to enablemetadataVersion- the version of the metadata to set in the exporter stateinitializeFrom- the id of another exporter to initialize metadata from. Can be null.- Returns:
- a future that completes when the exporter is enabled
-