public class ConfluentDataBalanceEngine extends Object implements DataBalanceEngine
Modifier and Type | Field and Description |
---|---|
static String |
BROKER_ADD_COUNT_METRIC_NAME |
Constructor and Description |
---|
ConfluentDataBalanceEngine(DataBalancerMetricsRegistry dataBalancerMetricsRegistry,
kafka.server.KafkaConfig config) |
Modifier and Type | Method and Description |
---|---|
void |
addBrokers(Set<Integer> brokersToAdd,
String uid) |
boolean |
cancelBrokerRemoval(int brokerId)
Cancels the on-going broker removal operations for the given #
brokerIds |
kafka.common.EvenClusterLoadStatusDescriptionInternal |
evenClusterLoadStatus(kafka.server.KafkaConfig kafkaConfig)
Return status of the goal violation detector triggered self balancing.
|
DataBalanceEngineContext |
getDataBalanceEngineContext()
Return
DataBalanceEngineContext associated with this DataBalanceEngine. |
boolean |
isActive()
Returns if CruiseControl is active and can work on balancing cluster.
|
void |
notifyDeadBrokers(Set<Integer> deadBrokers)
Notify CruiseControl of arrival of brokers that are no longer alive, either because
they were shutdown or not visible to controller because no heartbeat is being received.
|
void |
notifyNewBrokers(Set<Integer> newBrokers)
Notify CruiseControl of arrival of new brokers, which can be used to maintain
updated list of alive brokers.
|
void |
onActivation(EngineInitializationContext initializationContext)
To be called when this DataBalanceEngine should be activated and start running.
|
void |
onDeactivation(BalancerStatusStateMachine.BalancerEvent balancerEvent)
To be called when this DataBalanceEngine should stop execution.
|
void |
removeBroker(int brokerToRemove,
Optional<Long> brokerToRemoveEpoch,
String uid)
Schedules the removal of a broker
|
void |
setAutoHealMode(boolean shouldAutoHeal)
Enable or disable auto-healing (automatic execution of rebalance plans) when an imbalanced
cluster is detected and broker membership doesn't change.
|
void |
shutdown()
Called when the object is going away for good (end of broker lifetime).
|
void |
updateThrottle(Long newThrottle)
Update the replication throttles to be used during proposal execution.
|
public static final String BROKER_ADD_COUNT_METRIC_NAME
public ConfluentDataBalanceEngine(DataBalancerMetricsRegistry dataBalancerMetricsRegistry, kafka.server.KafkaConfig config)
public DataBalanceEngineContext getDataBalanceEngineContext()
DataBalanceEngine
DataBalanceEngineContext
associated with this DataBalanceEngine.getDataBalanceEngineContext
in interface DataBalanceEngine
public void onActivation(EngineInitializationContext initializationContext)
DataBalanceEngine
onActivation
in interface DataBalanceEngine
public void onDeactivation(BalancerStatusStateMachine.BalancerEvent balancerEvent)
DataBalanceEngine
onDeactivation
in interface DataBalanceEngine
balancerEvent
- - Balancer event leading to deactivation of DataBalanceEnginepublic void shutdown() throws InterruptedException
shutdown
in interface DataBalanceEngine
InterruptedException
public void updateThrottle(Long newThrottle)
DataBalanceEngine
updateThrottle
in interface DataBalanceEngine
newThrottle
- -- new throttle in bytes/second.public void setAutoHealMode(boolean shouldAutoHeal)
DataBalanceEngine
setAutoHealMode
in interface DataBalanceEngine
shouldAutoHeal
- -- if auto-healing should be enabled when goal violations are detected.public void removeBroker(int brokerToRemove, Optional<Long> brokerToRemoveEpoch, String uid)
DataBalanceEngine
removeBroker
in interface DataBalanceEngine
public void addBrokers(Set<Integer> brokersToAdd, String uid)
addBrokers
in interface DataBalanceEngine
public void notifyNewBrokers(Set<Integer> newBrokers)
DataBalanceEngine
notifyNewBrokers
in interface DataBalanceEngine
public void notifyDeadBrokers(Set<Integer> deadBrokers)
DataBalanceEngine
notifyDeadBrokers
in interface DataBalanceEngine
public boolean cancelBrokerRemoval(int brokerId)
brokerIds
cancelBrokerRemoval
in interface DataBalanceEngine
public boolean isActive()
#canAcceptRequests
in the sense we can accept requests even though CruiseControl hasn't
been started (say start event arrived but hasn't been processed yet).isActive
in interface DataBalanceEngine
public kafka.common.EvenClusterLoadStatusDescriptionInternal evenClusterLoadStatus(kafka.server.KafkaConfig kafkaConfig)
DataBalanceEngine
evenClusterLoadStatus
in interface DataBalanceEngine