Skip to content

Commit

Permalink
Drop enforcement that anomaly.detection.goals must be a subset of sel…
Browse files Browse the repository at this point in the history
…f.healing.goals (if non-empty)
  • Loading branch information
efeg authored and Adem Efe Gencer committed Mar 25, 2021
1 parent 2afccb2 commit ff59d7c
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ public <T> T getConfiguredInstance(String key, Class<T> t, Map<String, Object> c
* <li>{@link AnalyzerConfig#DEFAULT_GOALS_CONFIG} is a subset of {@link AnalyzerConfig#GOALS_CONFIG}.</li>
* <li>{@link AnalyzerConfig#HARD_GOALS_CONFIG} is a subset of {@link AnalyzerConfig#DEFAULT_GOALS_CONFIG}.</li>
* <li>{@link AnomalyDetectorConfig#SELF_HEALING_GOALS_CONFIG} is a subset of {@link AnalyzerConfig#DEFAULT_GOALS_CONFIG}.</li>
* <li>{@link AnomalyDetectorConfig#ANOMALY_DETECTION_GOALS_CONFIG} is a sublist of
* (1) {@link AnomalyDetectorConfig#SELF_HEALING_GOALS_CONFIG} if it is not empty,
* (2) {@link AnalyzerConfig#DEFAULT_GOALS_CONFIG} otherwise.</li>
* <li>{@link AnomalyDetectorConfig#ANOMALY_DETECTION_GOALS_CONFIG} is a sublist of {@link AnalyzerConfig#DEFAULT_GOALS_CONFIG} otherwise.</li>
* </ul>
*/
private void sanityCheckGoalNames() {
Expand Down Expand Up @@ -181,13 +179,6 @@ private void sanityCheckGoalNames() {
AnomalyDetectorConfig.SELF_HEALING_GOALS_CONFIG, selfHealingGoalNames,
AnalyzerConfig.DEFAULT_GOALS_CONFIG, defaultGoalNames));
}

// Ensure that goals used for anomaly detection are a subset of goals used for fixing the anomaly.
List<String> anomalyDetectionGoalNames = getList(AnomalyDetectorConfig.ANOMALY_DETECTION_GOALS_CONFIG);
if (anomalyDetectionGoalNames.stream().anyMatch(g -> selfHealingGoalNames.isEmpty() ? !defaultGoalNames.contains(g)
: !selfHealingGoalNames.contains(g))) {
throw new ConfigException("Attempt to configure anomaly detection goals as a superset of self healing goals.");
}
}

/**
Expand Down

0 comments on commit ff59d7c

Please sign in to comment.