@ThreadSafe public class BalancerEnabledConfig extends Object
isConfiguredAsEnabled()
and whether it should run shouldBeEnabled()
Constructor and Description |
---|
BalancerEnabledConfig(boolean isEnabled,
boolean isDemotionSupportEnabled) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isConfiguredAsEnabled() |
boolean |
maybeUpdate(boolean newEnabledValue,
boolean newDemotedBrokersExistValue)
Conditionally updates the config if the supplied values are different than the existing ones.
|
boolean |
maybeUpdateConfigValue(boolean newIsEnabledValue)
Conditionally updates the config's enabled variable.
|
boolean |
maybeUpdateDemotedBrokers(boolean newDemotedBrokersExistValue)
Conditionally updates the config's demoted brokers presence variable.
|
boolean |
shouldBeEnabled() |
String |
toString() |
public BalancerEnabledConfig(boolean isEnabled, boolean isDemotionSupportEnabled)
isEnabled
- - the configured enabled statusisDemotionSupportEnabled
- - whether support to keep balancer enabled when demoting brokerpublic boolean isConfiguredAsEnabled()
public boolean shouldBeEnabled()
isConfiguredAsEnabled()
in the fact that if there are demoted brokers present,
SBC should run/not run according to `ConfluentConfig#BALANCER_DEMOTION_SUPPORT_ENABLED_SBC_CONFIG`.public boolean maybeUpdateDemotedBrokers(boolean newDemotedBrokersExistValue)
newDemotedBrokersExistValue
- - whether the cluster has any demoted brokers. In such cases,
we would enable/disable Sbc according to `ConfluentConfig#BALANCER_DEMOTION_SUPPORT_ENABLED_SBC_CONFIG`.shouldBeEnabled()
differs with the new values.public boolean maybeUpdateConfigValue(boolean newIsEnabledValue)
newIsEnabledValue
- - whether the config has SBC configured as enabled.shouldBeEnabled()
differs with the new values.public boolean maybeUpdate(boolean newEnabledValue, boolean newDemotedBrokersExistValue)
newEnabledValue
- - the configured SBC enabled statusnewDemotedBrokersExistValue
- - whether the cluster has any demoted brokers. In such cases, we want SBC to be temporarily disabled.shouldBeEnabled()
differs with the new values.