Search in sources :

Example 1 with UpdateSelfHealingParameters

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);
        }
    }
}
Also used : UpdateSelfHealingParameters(com.linkedin.kafka.cruisecontrol.servlet.parameters.UpdateSelfHealingParameters) AnomalyType(com.linkedin.cruisecontrol.detector.AnomalyType)

Aggregations

AnomalyType (com.linkedin.cruisecontrol.detector.AnomalyType)1 UpdateSelfHealingParameters (com.linkedin.kafka.cruisecontrol.servlet.parameters.UpdateSelfHealingParameters)1