apucher commented on a change in pull request #3586: [TE] detection pipeline - 
multiple improvements
URL: https://github.com/apache/incubator-pinot/pull/3586#discussion_r239296644
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/detection/DetectionResource.java
 ##########
 @@ -164,11 +172,102 @@ public Response detectionPreview(
     return Response.ok(result).build();
   }
 
+  // return default bucket size based on cron schedule.
+  private long getBucketSize(DetectionConfigDTO config){
+    switch (config.getCron()) {
+      case DAILY_CRON:
+        // daily
+        return TimeUnit.DAYS.toMillis(1) + 1;
+      case MINUTE_CRON:
+        // minute level
+        return TimeUnit.MINUTES.toMillis(15);
+      case HOURLY_CRON:
+        // hourly
+        return TimeUnit.HOURS.toMillis(1);
+    }
+    throw new IllegalArgumentException("bucket size not determined");
+  }
+
+  // return default window size based on cron schedule.
+  private long getWindowSize(DetectionConfigDTO config) {
+    switch (config.getCron()) {
+      case DAILY_CRON:
+        // daily
+        return TimeUnit.DAYS.toMillis(1);
 
 Review comment:
   Should there be a +1 here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to