@ThreadSafe
public class SbkAdminUtils
extends java.lang.Object
Constructor and Description |
---|
SbkAdminUtils(org.apache.kafka.clients.admin.ConfluentAdmin adminClient,
KafkaCruiseControlConfig config) |
Modifier and Type | Method and Description |
---|---|
int |
cancelInterBrokerReplicaMovements(java.util.List<org.apache.kafka.common.TopicPartition> partitionReassignmentsToCancel)
Cancels any partition reassignments for the given topic partitions
|
AdminClientResult<KafkaCluster> |
describeCluster()
Describes the Kafka cluster, listing all the online brokers.
|
AdminClientResult<KafkaCluster> |
describeCluster(long timeoutMs)
Describes the Kafka cluster, listing all the online brokers.
|
void |
executeIntraBrokerReplicaMovements(java.util.List<ExecutionTask> tasksToExecute,
ExecutionTaskManager executionTaskManager)
Execute intra-broker replica movement tasks by sending alterReplicaLogDirs request.
|
java.util.Map<ExecutionTask,org.apache.kafka.clients.admin.DescribeReplicaLogDirsResult.ReplicaLogDirInfo> |
getLogdirInfoForExecutionTask(java.util.Collection<ExecutionTask> tasks)
Fetch the logdir information for subject replicas in intra-broker replica movement tasks.
|
java.util.List<java.lang.Integer> |
getReplicasForPartition(org.apache.kafka.common.TopicPartition topicPartition)
Returns the replicas for a given partition.
|
boolean |
isOngoingIntraBrokerReplicaMovement(java.util.Collection<java.lang.Integer> brokersToCheck)
Check whether there is ongoing intra-broker replica movement.
|
public SbkAdminUtils(org.apache.kafka.clients.admin.ConfluentAdmin adminClient, KafkaCruiseControlConfig config)
public AdminClientResult<KafkaCluster> describeCluster() throws java.lang.InterruptedException
describeClusterResponseTimeoutMs
.AdminClientResult
.java.lang.InterruptedException
public AdminClientResult<KafkaCluster> describeCluster(long timeoutMs) throws java.lang.InterruptedException
timeoutMs
.AdminClientResult
.java.lang.InterruptedException
public java.util.List<java.lang.Integer> getReplicasForPartition(org.apache.kafka.common.TopicPartition topicPartition)
topicPartition
- the partition to fetch the replicas forpublic int cancelInterBrokerReplicaMovements(java.util.List<org.apache.kafka.common.TopicPartition> partitionReassignmentsToCancel)
public java.util.Map<ExecutionTask,org.apache.kafka.clients.admin.DescribeReplicaLogDirsResult.ReplicaLogDirInfo> getLogdirInfoForExecutionTask(java.util.Collection<ExecutionTask> tasks)
tasks
- The tasks to check.public void executeIntraBrokerReplicaMovements(java.util.List<ExecutionTask> tasksToExecute, ExecutionTaskManager executionTaskManager)
tasksToExecute
- The tasks to execute.executionTaskManager
- The task manager to do bookkeeping for task execution state.public boolean isOngoingIntraBrokerReplicaMovement(java.util.Collection<java.lang.Integer> brokersToCheck)
brokersToCheck
- List of broker to check.