use of com.linkedin.thirdeye.anomaly.merge.TimeBasedAnomalyMerger in project pinot by linkedin.
the class DetectionTaskRunner method runTask.
private void runTask(DateTime windowStart, DateTime windowEnd) throws JobExecutionException, ExecutionException {
LOG.info("Running anomaly detection for time range {} to {}", windowStart, windowEnd);
// TODO: Change to DataFetchers/DataSources
AnomalyDetectionInputContext adContext = fetchData(windowStart, windowEnd);
ListMultimap<DimensionMap, RawAnomalyResultDTO> resultRawAnomalies = dimensionalShuffleAndUnifyAnalyze(windowStart, windowEnd, adContext);
detectionTaskSuccessCounter.inc();
boolean isBackfill = false;
// If the current job is a backfill (adhoc) detection job, set notified flag to true so the merged anomalies do not
// induce alerts and emails.
String jobName = DAO_REGISTRY.getJobDAO().getJobNameByJobId(jobExecutionId);
if (jobName != null && jobName.toLowerCase().startsWith(BACKFILL_PREFIX)) {
isBackfill = true;
}
// Update merged anomalies
TimeBasedAnomalyMerger timeBasedAnomalyMerger = new TimeBasedAnomalyMerger(anomalyFunctionFactory);
ListMultimap<DimensionMap, MergedAnomalyResultDTO> resultMergedAnomalies = timeBasedAnomalyMerger.mergeAnomalies(anomalyFunctionSpec, resultRawAnomalies, isBackfill);
detectionTaskSuccessCounter.inc();
// TODO: Change to DataSink
AnomalyDetectionOutputContext adOutputContext = new AnomalyDetectionOutputContext();
adOutputContext.setRawAnomalies(resultRawAnomalies);
adOutputContext.setMergedAnomalies(resultMergedAnomalies);
storeData(adOutputContext);
}
Aggregations