use of com.linkedin.kafka.cruisecontrol.servlet.parameters.UpdateSelfHealingParameters in project cruise-control by linkedin.
the class AdminRequest method processUpdateSelfHealingRequest.
protected void processUpdateSelfHealingRequest(Map<AnomalyType, Boolean> selfHealingBefore, Map<AnomalyType, Boolean> selfHealingAfter) {
UpdateSelfHealingParameters updateSelfHealingParameters = _parameters.updateSelfHealingParameters();
if (updateSelfHealingParameters != null) {
Set<AnomalyType> disableSelfHealingFor = updateSelfHealingParameters.disableSelfHealingFor();
Set<AnomalyType> enableSelfHealingFor = updateSelfHealingParameters.enableSelfHealingFor();
for (AnomalyType anomalyType : disableSelfHealingFor) {
selfHealingBefore.put(anomalyType, _kafkaCruiseControl.setSelfHealingFor(anomalyType, false));
selfHealingAfter.put(anomalyType, false);
}
for (AnomalyType anomalyType : enableSelfHealingFor) {
selfHealingBefore.put(anomalyType, _kafkaCruiseControl.setSelfHealingFor(anomalyType, true));
selfHealingAfter.put(anomalyType, true);
}
if (!disableSelfHealingFor.isEmpty() || !enableSelfHealingFor.isEmpty()) {
LOG.info("Self healing state is modified by user (before: {} after: {}).", selfHealingBefore, selfHealingAfter);
}
}
}
Aggregations