public class AnomalyDetector extends Object
Constructor and Description |
---|
AnomalyDetector(KafkaCruiseControlConfig config,
org.apache.kafka.clients.admin.ConfluentAdmin adminClient,
LoadMonitor loadMonitor,
KafkaCruiseControl kafkaCruiseControl,
org.apache.kafka.common.utils.Time time,
DataBalancerMetricsRegistry metricRegistry,
ApiStatePersistenceStore persistenceStore,
UpdatableSbcGoalsConfig updatableSbcGoalsConfig) |
Modifier and Type | Method and Description |
---|---|
AnomalyDetectorState |
anomalyDetectorState() |
boolean |
canGoalViolationBeFixed() |
EvenClusterLoadStateManager |
init(Integer brokerId,
KafkaCruiseControl.CcStartupMode startupMode,
BrokerAdditionV2StateManager brokerAdditionV2StateManager) |
void |
markSelfHealingFinished(String anomalyId)
Update anomaly status once associated self-healing operation has finished.
|
void |
maybeClearOngoingAnomalyDetectionTimeMs()
|
void |
notifyDeadBrokers(Set<Integer> deadBrokers) |
void |
notifyNewAddingBrokers(Set<Integer> newBrokersBeingAdded)
Notifies the detectors of the set of broker ids
newBrokersBeingAdded that just came online in the cluster and are being added to it. |
void |
notifyNewlyOnlineBrokers(Set<Integer> newlyOnlineBrokers)
Notifies the detectors of the set of broker ids
newlyOnlineBrokers that just came online in the cluster. |
long |
numCheckedWithDelay() |
boolean |
setSelfHealingFor(AnomalyType anomalyType,
boolean isSelfHealingEnabled)
(1) Enable or disable self healing for the given anomaly type and (2) update the cached anomaly detector state.
|
void |
shutdown()
Shutdown the anomaly detector.
|
void |
startDetection() |
boolean |
unevenLoadSelfHealingEnabled()
Returns whether self-healing is enabled to fix goal violation anomaly.
|
public AnomalyDetector(KafkaCruiseControlConfig config, org.apache.kafka.clients.admin.ConfluentAdmin adminClient, LoadMonitor loadMonitor, KafkaCruiseControl kafkaCruiseControl, org.apache.kafka.common.utils.Time time, DataBalancerMetricsRegistry metricRegistry, ApiStatePersistenceStore persistenceStore, UpdatableSbcGoalsConfig updatableSbcGoalsConfig)
public EvenClusterLoadStateManager init(Integer brokerId, KafkaCruiseControl.CcStartupMode startupMode, BrokerAdditionV2StateManager brokerAdditionV2StateManager)
public void startDetection()
public void shutdown()
public AnomalyDetectorState anomalyDetectorState()
public boolean canGoalViolationBeFixed()
public void maybeClearOngoingAnomalyDetectionTimeMs()
public boolean setSelfHealingFor(AnomalyType anomalyType, boolean isSelfHealingEnabled)
anomalyType
- Type of anomaly for which to enable or disable self healing.isSelfHealingEnabled
- True if self healing is enabled, false otherwise.public boolean unevenLoadSelfHealingEnabled()
public long numCheckedWithDelay()
public void markSelfHealingFinished(String anomalyId)
anomalyId
- Unique id of anomaly which triggered self-healing operation.public void notifyNewAddingBrokers(Set<Integer> newBrokersBeingAdded)
newBrokersBeingAdded
that just came online in the cluster and are being added to it.public void notifyNewlyOnlineBrokers(Set<Integer> newlyOnlineBrokers)
newlyOnlineBrokers
that just came online in the cluster.
Notably, this does NOT include empty brokers that just came online in the cluster - those are notified via notifyNewAddingBrokers(Set)
newlyOnlineBrokers
- the set of non-empty broker ids that just came online in the cluster