public class SelfHealingNotifier extends java.lang.Object implements AnomalyNotifier
Modifier and Type | Field and Description |
---|---|
protected long |
_brokerFailureAlertThresholdMs |
protected long |
_notifierStartTimeMs |
protected java.util.Map<AnomalyType,java.lang.Boolean> |
_selfHealingEnabled |
protected java.util.Map<AnomalyType,java.lang.Long> |
_selfHealingEnabledHistoricalDurationMs |
protected java.util.Map<java.lang.Boolean,java.util.Map<AnomalyType,java.lang.Long>> |
_selfHealingStateChangeTimeMs |
protected long |
_selfHealingThresholdMs |
protected org.apache.kafka.common.utils.Time |
_time |
Constructor and Description |
---|
SelfHealingNotifier() |
Modifier and Type | Method and Description |
---|---|
void |
alert(java.lang.Object anomaly,
boolean autoFixTriggered,
long selfHealingStartTime,
AnomalyType anomalyType)
Alert on anomaly.
|
void |
configure(java.util.Map<java.lang.String,?> config)
Configure this class with the given key-value pairs
|
AnomalyNotificationResult |
onBrokerFailure(BrokerFailures brokerFailures)
The method will be called when a broker failure has been detected.
|
AnomalyNotificationResult |
onGoalViolation(GoalViolations goalViolations)
When a particular goal is violated this method will be called.
|
java.util.Map<AnomalyType,java.lang.Boolean> |
selfHealingEnabled()
Check whether the self healing is enabled for different anomaly types.
|
java.util.Map<AnomalyType,java.lang.Float> |
selfHealingEnabledRatio()
Get the ratio during which the self-healing is enabled over the total operating time.
|
boolean |
setSelfHealingFor(AnomalyType anomalyType,
boolean isSelfHealingEnabled)
Enable or disable self healing for the given anomaly type.
|
long |
uptimeMs(long nowMs) |
protected final org.apache.kafka.common.utils.Time _time
protected final long _notifierStartTimeMs
protected final java.util.Map<AnomalyType,java.lang.Boolean> _selfHealingEnabled
protected final java.util.Map<java.lang.Boolean,java.util.Map<AnomalyType,java.lang.Long>> _selfHealingStateChangeTimeMs
protected final java.util.Map<AnomalyType,java.lang.Long> _selfHealingEnabledHistoricalDurationMs
protected long _brokerFailureAlertThresholdMs
protected long _selfHealingThresholdMs
public AnomalyNotificationResult onGoalViolation(GoalViolations goalViolations)
AnomalyNotifier
onGoalViolation
in interface AnomalyNotifier
goalViolations
- The detected goal violations.AnomalyNotificationResult.Action
.public java.util.Map<AnomalyType,java.lang.Boolean> selfHealingEnabled()
AnomalyNotifier
selfHealingEnabled
in interface AnomalyNotifier
public boolean setSelfHealingFor(AnomalyType anomalyType, boolean isSelfHealingEnabled)
AnomalyNotifier
setSelfHealingFor
in interface AnomalyNotifier
anomalyType
- Type of anomaly for which to enable or disable self healing.isSelfHealingEnabled
- True if self healing is enabled, false otherwise.public java.util.Map<AnomalyType,java.lang.Float> selfHealingEnabledRatio()
AnomalyNotifier
selfHealingEnabledRatio
in interface AnomalyNotifier
public AnomalyNotificationResult onBrokerFailure(BrokerFailures brokerFailures)
AnomalyNotifier
onBrokerFailure
in interface AnomalyNotifier
brokerFailures
- the detected broker failuresAnomalyNotificationResult.Action
.public void alert(java.lang.Object anomaly, boolean autoFixTriggered, long selfHealingStartTime, AnomalyType anomalyType)
anomaly
- Detected anomaly.autoFixTriggered
- True if auto fix has been triggered, false otherwise.selfHealingStartTime
- The time that the self healing started.anomalyType
- Type of anomaly.public void configure(java.util.Map<java.lang.String,?> config)
CruiseControlConfigurable
configure
in interface CruiseControlConfigurable
public long uptimeMs(long nowMs)
uptimeMs
in interface AnomalyNotifier
nowMs
- Current time in ms.