public interface ClusterBalanceManager
extends org.apache.kafka.image.MetadataImageListener
Modifier and Type | Interface and Description |
---|---|
static interface |
ClusterBalanceManager.BalanceManagerOperationInvocationClientCallback
The interface defining the client response callback for operation invocation (like broker removal or
even-cluster-load triggering): a request which merely returns a success or failure and no other data.
|
static interface |
ClusterBalanceManager.BalanceManagerStatusQueryClientCallback<R>
Interface for Status Query Response callbacks.
|
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
void |
balancerStatus(ClusterBalanceManager.BalanceManagerStatusQueryClientCallback<BalancerStatusDescriptionInternal> cb) |
void |
brokerAdditions(ClusterBalanceManager.BalanceManagerStatusQueryClientCallback<List<BrokerAdditionDescriptionInternal>> cb) |
void |
brokerRemovals(ClusterBalanceManager.BalanceManagerStatusQueryClientCallback<List<BrokerRemovalDescriptionInternal>> cb) |
static ClusterBalanceManager |
clusterBalanceManager(kafka.server.KafkaConfig config)
Instantiate the ClusterBalanceManager based on the config
|
void |
evenClusterLoadStatus(ClusterBalanceManager.BalanceManagerStatusQueryClientCallback<EvenClusterLoadStatusDescriptionInternal> cb)
Return status of the goal violation detector triggered self balancing.
|
void |
onAlteredExclusions(Set<Integer> newExclusions,
Set<Integer> removedExclusions)
Notify the data balance manager of alterations in the set of active broker replica exclusions
|
void |
onBrokerLeadershipPriorityChange(AliveBrokersMetadata aliveBrokersMetadata)
Notify the data balance manager when the broker leadership priority changes.
|
void |
onBrokersFailure(Set<Integer> deadBrokers)
Notify the balancer manager of brokers that are dead, either because they are shutdown or because
they are not known to controller anymore (no heartbeat).
|
void |
onBrokersStartup(Set<Integer> emptyBrokers,
Set<Integer> newBrokers,
AliveBrokersMetadata aliveBrokersMetadata)
Notify the balance manager of newly-started brokers for it to take action on the event
(e.g schedule a broker add operation or cancel an ongoing broker removal)
|
void |
scheduleKraftBrokerRemoval(List<Integer> brokersToRemove,
boolean shouldShutdown,
ClusterBalanceManager.BalanceManagerOperationInvocationClientCallback cb)
Schedule a broker removal operation for a cluster using KRaft
|
void |
scheduleZkBrokerRemoval(List<Integer> brokersToRemove,
boolean shouldShutdown,
TopicsMetadataSnapshot topicsMetadataSnapshot,
AliveBrokersMetadata aliveBrokersMetadata,
ClusterBalanceManager.BalanceManagerOperationInvocationClientCallback cb)
Schedule a broker removal operation for a cluster using ZooKeeper
|
void |
shutdown()
Notify node shutdown
|
void |
triggerEvenClusterLoadTask(ClusterBalanceManager.BalanceManagerOperationInvocationClientCallback cb)
Serves manual request to run a general rebalance on the cluster for the even cluster load
task.
|
void shutdown()
void scheduleZkBrokerRemoval(List<Integer> brokersToRemove, boolean shouldShutdown, TopicsMetadataSnapshot topicsMetadataSnapshot, AliveBrokersMetadata aliveBrokersMetadata, ClusterBalanceManager.BalanceManagerOperationInvocationClientCallback cb)
brokersToRemove
- the list of broker ids to remove from the clustershouldShutdown
- whether the brokers being removed should be shut down as part of the removaltopicsMetadataSnapshot
- the latest snapshot of topic metadata in the clusteraliveBrokersMetadata
- a metadata snapshot of the live brokers in the clustercb
- A callback to be called when the operation is scheduledvoid scheduleKraftBrokerRemoval(List<Integer> brokersToRemove, boolean shouldShutdown, ClusterBalanceManager.BalanceManagerOperationInvocationClientCallback cb)
brokersToRemove
- the list of broker ids to remove from the clustershouldShutdown
- whether the brokers being removed should be shut down as part of the removalcb
- A callback to be called when the operation is scheduledvoid onBrokersStartup(Set<Integer> emptyBrokers, Set<Integer> newBrokers, AliveBrokersMetadata aliveBrokersMetadata)
emptyBrokers
- - the set of broker IDs that have just started up and contain no replicas on themnewBrokers
- - a superset of `emptyBrokers`, this contains all the brokers that have just started upaliveBrokersMetadata
- a metadata snapshot of the brokers in the cluster that are onlinevoid onBrokersFailure(Set<Integer> deadBrokers)
deadBrokers
- - the set of brokers that have been identified as failingvoid onAlteredExclusions(Set<Integer> newExclusions, Set<Integer> removedExclusions)
void brokerRemovals(ClusterBalanceManager.BalanceManagerStatusQueryClientCallback<List<BrokerRemovalDescriptionInternal>> cb)
void brokerAdditions(ClusterBalanceManager.BalanceManagerStatusQueryClientCallback<List<BrokerAdditionDescriptionInternal>> cb)
void balancerStatus(ClusterBalanceManager.BalanceManagerStatusQueryClientCallback<BalancerStatusDescriptionInternal> cb)
void evenClusterLoadStatus(ClusterBalanceManager.BalanceManagerStatusQueryClientCallback<EvenClusterLoadStatusDescriptionInternal> cb)
void triggerEvenClusterLoadTask(ClusterBalanceManager.BalanceManagerOperationInvocationClientCallback cb)
void onBrokerLeadershipPriorityChange(AliveBrokersMetadata aliveBrokersMetadata)
aliveBrokersMetadata
- the latest brokers metatada for the clusterstatic ClusterBalanceManager clusterBalanceManager(kafka.server.KafkaConfig config)
config
- The KafkaConfig used to start up this serverNoOpClusterBalanceManager
otherwise.