public class KafkaDataBalanceManager extends Object implements kafka.controller.DataBalanceManager
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVE_BALANCER_COUNT_METRIC_NAME |
static String |
BALANCER_STATE_METRIC_NAME |
static String |
BROKER_ADDITION_STATE_METRIC_NAME |
static String |
BROKER_REMOVAL_STATE_METRIC_NAME |
Constructor and Description |
---|
KafkaDataBalanceManager(kafka.server.KafkaConfig kafkaConfig)
Create a KafkaDataBalanceManager.
|
Modifier and Type | Method and Description |
---|---|
kafka.common.BalancerStatusDescriptionInternal |
balancerStatus() |
BalancerStatusTracker |
balancerStatusTracker() |
List<kafka.common.BrokerAdditionDescriptionInternal> |
brokerAdditions() |
List<kafka.common.BrokerRemovalDescriptionInternal> |
brokerRemovals()
Returns the latest state for each broker being removed
|
kafka.common.EvenClusterLoadStatusDescriptionInternal |
evenClusterLoadStatus() |
DataBalanceEngine |
getBalanceEngine() |
kafka.server.KafkaConfig |
getKafkaConfig() |
boolean |
isActive() |
void |
onAlteredExclusions(Set<Integer> newExclusions,
Set<Integer> removedExclusions) |
void |
onBrokerLeadershipPriorityChange(boolean demotedBrokersExist)
Attempts to disable SBC if demoted brokers exist.
|
void |
onBrokersFailure(Set<Integer> deadBrokers) |
void |
onBrokersStartup(Set<Integer> emptyBrokers,
Set<Integer> newBrokers,
kafka.common.AliveBrokersSnapshot brokersSnapshot) |
void |
onElection(kafka.common.AliveBrokersSnapshot aliveBrokersSnapshot)
Start-up the DataBalanceManager.
|
void |
onLeaderUpdate(OptionalInt leaderId) |
void |
onMetadataImageUpdate(org.apache.kafka.image.MetadataDelta metadataDelta,
org.apache.kafka.image.MetadataImage newMetadataImage) |
void |
onResignation()
When the broker ceases to be the primary DataBalancer in the cluster.
|
void |
scheduleBrokerRemoval(kafka.common.BrokerRemovalRequest removalRequest,
kafka.common.AliveBrokersSnapshot brokersSnapshot) |
void |
shutdown()
To be called when the KafkaDataBalanceManager is being fully shut down, rather
than temporarily disabled for later startup.
|
void |
triggerEvenClusterLoadTask() |
void |
updateConfig(kafka.server.KafkaConfig oldConfig,
kafka.server.KafkaConfig newConfig)
Updates the internal cruiseControl configuration based on dynamic property updates in the broker's KafkaConfig
|
public static final String ACTIVE_BALANCER_COUNT_METRIC_NAME
public static final String BROKER_REMOVAL_STATE_METRIC_NAME
public static final String BROKER_ADDITION_STATE_METRIC_NAME
public static final String BALANCER_STATE_METRIC_NAME
public KafkaDataBalanceManager(kafka.server.KafkaConfig kafkaConfig)
public void onElection(kafka.common.AliveBrokersSnapshot aliveBrokersSnapshot)
onElection
in interface kafka.controller.DataBalanceManager
public boolean isActive()
public BalancerStatusTracker balancerStatusTracker()
public void onResignation()
onResignation
in interface kafka.controller.DataBalanceManager
public void shutdown()
shutdown
in interface kafka.controller.ClusterBalanceManager
public void updateConfig(kafka.server.KafkaConfig oldConfig, kafka.server.KafkaConfig newConfig)
updateConfig
in interface kafka.controller.DataBalanceManager
public void onBrokersStartup(Set<Integer> emptyBrokers, Set<Integer> newBrokers, kafka.common.AliveBrokersSnapshot brokersSnapshot)
onBrokersStartup
in interface kafka.controller.ClusterBalanceManager
public void onBrokersFailure(Set<Integer> deadBrokers)
onBrokersFailure
in interface kafka.controller.ClusterBalanceManager
public void onAlteredExclusions(Set<Integer> newExclusions, Set<Integer> removedExclusions)
onAlteredExclusions
in interface kafka.controller.ClusterBalanceManager
public void onLeaderUpdate(OptionalInt leaderId)
onLeaderUpdate
in interface org.apache.kafka.image.MetadataImageListener
public void onMetadataImageUpdate(org.apache.kafka.image.MetadataDelta metadataDelta, org.apache.kafka.image.MetadataImage newMetadataImage)
onMetadataImageUpdate
in interface org.apache.kafka.image.MetadataImageListener
public void onBrokerLeadershipPriorityChange(boolean demotedBrokersExist)
onBrokerLeadershipPriorityChange
in interface kafka.controller.ClusterBalanceManager
demotedBrokersExist
- public List<kafka.common.BrokerRemovalDescriptionInternal> brokerRemovals()
brokerRemovals
in interface kafka.controller.ClusterBalanceManager
public List<kafka.common.BrokerAdditionDescriptionInternal> brokerAdditions()
brokerAdditions
in interface kafka.controller.ClusterBalanceManager
public kafka.common.BalancerStatusDescriptionInternal balancerStatus()
balancerStatus
in interface kafka.controller.ClusterBalanceManager
public void triggerEvenClusterLoadTask()
triggerEvenClusterLoadTask
in interface kafka.controller.ClusterBalanceManager
public kafka.common.EvenClusterLoadStatusDescriptionInternal evenClusterLoadStatus()
evenClusterLoadStatus
in interface kafka.controller.ClusterBalanceManager
public void scheduleBrokerRemoval(kafka.common.BrokerRemovalRequest removalRequest, kafka.common.AliveBrokersSnapshot brokersSnapshot)
scheduleBrokerRemoval
in interface kafka.controller.ClusterBalanceManager
public DataBalanceEngine getBalanceEngine()
public kafka.server.KafkaConfig getKafkaConfig()