public interface ReplicaMovementStrategy
Modifier and Type | Method and Description |
---|---|
Map<Integer,SortedSet<ExecutionTask>> |
applyStrategy(Set<ExecutionTask> replicaMovementTasks,
org.apache.kafka.common.Cluster cluster)
Determine the execution order for replica movement tasks based on a customized strategy.
|
ReplicaMovementStrategy |
chain(ReplicaMovementStrategy strategy)
Chain with another replica movement strategy to create a composite strategy.The returned strategy should use a combined rule
of two strategies in determining the task execution order.
|
static ReplicaMovementStrategy |
generateChainedReplicaMovementStrategies(List<String> replicaMovementStrategiesList)
A helper method to compose ReplicaMovementStrategies together.
|
String |
name()
Get the name of this strategy.
|
Comparator<ExecutionTask> |
taskComparator(org.apache.kafka.common.Cluster cluster)
Generate a comparator for replica movement task which incorporate the strategy to apply.
|
Map<Integer,SortedSet<ExecutionTask>> applyStrategy(Set<ExecutionTask> replicaMovementTasks, org.apache.kafka.common.Cluster cluster)
replicaMovementTasks
- The replica movement tasks to be executed.cluster
- The current cluster state.ReplicaMovementStrategy chain(ReplicaMovementStrategy strategy)
strategy
- The other replica movement strategy.Comparator<ExecutionTask> taskComparator(org.apache.kafka.common.Cluster cluster)
cluster
- The current cluster state.String name()
static ReplicaMovementStrategy generateChainedReplicaMovementStrategies(List<String> replicaMovementStrategiesList)
replicaMovementStrategiesList
- -- a list of ReplicaMovementStrategies to utilize, in decreasing-priority order (highest-priority first).