public class ConfluentDataBalanceEngine extends java.lang.Object implements DataBalanceEngine
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BROKER_ADD_COUNT_METRIC_NAME |
Constructor and Description |
---|
ConfluentDataBalanceEngine(DataBalancerMetricsRegistry dataBalancerMetricsRegistry,
kafka.server.KafkaConfig config) |
Modifier and Type | Method and Description |
---|---|
void |
addBrokers(java.util.Set<java.lang.Integer> brokersToAdd,
java.lang.String uid) |
boolean |
cancelBrokerRemoval(int brokerId)
Cancels the on-going broker removal operations for the given #
brokerIds |
DataBalanceEngineContext |
getDataBalanceEngineContext()
Return
DataBalanceEngineContext associated with this DataBalanceEngine. |
boolean |
isActive()
Returns if CruiseControl is active and can work on balancing cluster.
|
void |
onActivation(EngineInitializationContext initializationContext)
To be called when this DataBalanceEngine should be activated and start running.
|
void |
onDeactivation()
To be called when this DataBalanceEngine should stop execution.
|
void |
removeBroker(int brokerToRemove,
java.util.Optional<java.lang.Long> brokerToRemoveEpoch,
java.lang.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(java.lang.Long newThrottle)
Update the replication throttles to be used during proposal execution.
|
public static final java.lang.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()
DataBalanceEngine
onDeactivation
in interface DataBalanceEngine
public void shutdown() throws java.lang.InterruptedException
shutdown
in interface DataBalanceEngine
java.lang.InterruptedException
public void updateThrottle(java.lang.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, java.util.Optional<java.lang.Long> brokerToRemoveEpoch, java.lang.String uid)
DataBalanceEngine
removeBroker
in interface DataBalanceEngine
public void addBrokers(java.util.Set<java.lang.Integer> brokersToAdd, java.lang.String uid)
addBrokers
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