You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xh...@apache.org on 2019/04/02 17:18:23 UTC

[incubator-pinot] branch revert_early_termination created (now b888e35)

This is an automated email from the ASF dual-hosted git repository.

xhsun pushed a change to branch revert_early_termination
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at b888e35  [TE] revert early termination in detection loop

This branch includes the following new commits:

     new b888e35  [TE] revert early termination in detection loop

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[incubator-pinot] 01/01: [TE] revert early termination in detection loop

Posted by xh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xhsun pushed a commit to branch revert_early_termination
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit b888e35495db677ce8170ccb24a9ac3ce22f6fde
Author: Xiaohui Sun <xh...@xhsun-mn3.linkedin.biz>
AuthorDate: Tue Apr 2 10:18:05 2019 -0700

    [TE] revert early termination in detection loop
---
 .../detection/wrapper/AnomalyDetectorWrapper.java  | 25 +++++-----------------
 1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/wrapper/AnomalyDetectorWrapper.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/wrapper/AnomalyDetectorWrapper.java
index b888379..909c47a 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/wrapper/AnomalyDetectorWrapper.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/wrapper/AnomalyDetectorWrapper.java
@@ -160,9 +160,12 @@ public class AnomalyDetectorWrapper extends DetectionPipeline {
     List<MergedAnomalyResultDTO> anomalies = new ArrayList<>();
     int totalWindows = monitoringWindows.size();
     int successWindows = 0;
-    Exception lastException = null;
     for (int i = 0; i < totalWindows; i++) {
-      earlyTerminate(i, successWindows, totalWindows, lastException);
+      if (i == EARLY_TERMINATE_WINDOW && successWindows == 0) {
+        LOG.error("Successive first {}/{} detection windows failed for config {} metricUrn {}. Discard remaining windows",
+            EARLY_TERMINATE_WINDOW, totalWindows, config.getId(), metricUrn);
+        break;
+      }
 
       // run detection
       Interval window = monitoringWindows.get(i);
@@ -177,22 +180,14 @@ public class AnomalyDetectorWrapper extends DetectionPipeline {
         successWindows++;
       }
       catch (DetectorDataInsufficientException e) {
-        lastException = e;
         LOG.warn("[DetectionConfigID{}] Insufficient data ro run detection for window {} to {}.", this.config.getId(), window.getStart(), window.getEnd());
       }
       catch (Exception e) {
-        lastException = e;
         LOG.warn("[DetectionConfigID{}] detecting anomalies for window {} to {} failed.", this.config.getId(), window.getStart(), window.getEnd(), e);
       }
       anomalies.addAll(anomaliesForOneWindow);
     }
 
-    // throw exception if all windows failed
-    if (successWindows == 0 && totalWindows > 0) {
-      LOG.error("All {} detection windows failed for config {} metricUrn {}.", totalWindows, config.getId(), metricUrn);
-      throw new DetectorException("All " + totalWindows + " detection windows failed.", lastException);
-    }
-
     for (MergedAnomalyResultDTO anomaly : anomalies) {
       anomaly.setDetectionConfigId(this.config.getId());
       anomaly.setMetricUrn(this.metricUrn);
@@ -206,16 +201,6 @@ public class AnomalyDetectorWrapper extends DetectionPipeline {
         Collectors.toList()), lastTimeStamp);
   }
 
-  private void earlyTerminate(int currentWindows, int successWindows, int totalWindows, Exception lastException)
-      throws DetectorException {
-    // early termination if first of the EARLY_TERMINATE_WINDOW all failed
-    if (currentWindows == EARLY_TERMINATE_WINDOW && successWindows == 0) {
-      LOG.error("Successive first {} detection windows failed for config {} metricUrn {}.", EARLY_TERMINATE_WINDOW, config.getId(), metricUrn);
-      throw new DetectorException(String.format("Successive first %d/%d detection windows failed.", EARLY_TERMINATE_WINDOW, totalWindows),
-          lastException);
-    }
-  }
-
   // guess-timate next time stamp
   // there are two cases. If the data is complete, next detection starts from the end time of this detection
   // If data is incomplete, next detection starts from the latest available data's time stamp plus the one time granularity.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org