You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ji...@apache.org on 2019/01/15 19:15:04 UTC

[incubator-pinot] branch master updated: [TE] detection - update tunable interface (#3689)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9e82f5e  [TE] detection - update tunable interface (#3689)
9e82f5e is described below

commit 9e82f5e8ef968184917019645140d9d8f2502908
Author: Jihao Zhang <ji...@linkedin.com>
AuthorDate: Tue Jan 15 11:14:58 2019 -0800

    [TE] detection - update tunable interface (#3689)
    
    update the tunable interface to include metric urn.
---
 .../pinot/thirdeye/detection/spi/components/Tunable.java  | 15 ++++++++-------
 .../detection/yaml/CompositePipelineConfigTranslator.java |  3 ++-
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/spi/components/Tunable.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/spi/components/Tunable.java
index 8fa9ebe..b521ddd 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/spi/components/Tunable.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/spi/components/Tunable.java
@@ -19,10 +19,8 @@
 
 package org.apache.pinot.thirdeye.detection.spi.components;
 
-import org.apache.pinot.thirdeye.detection.spec.AbstractSpec;
-import org.apache.pinot.thirdeye.detection.spi.model.InputData;
-import org.apache.pinot.thirdeye.detection.spi.model.InputDataSpec;
 import java.util.Map;
+import org.apache.pinot.thirdeye.detection.spec.AbstractSpec;
 import org.joda.time.Interval;
 
 /**
@@ -31,9 +29,12 @@ import org.joda.time.Interval;
  */
 public interface Tunable<T extends AbstractSpec> extends BaseComponent<T> {
   /**
-   * Returns the new spec for the component it's tuning
-   * @param currentSpec current spec for the component. empty if not exist
-   * @return the init spec for the component it's tuning
+   * Returns the new spec for the component it's tuning for a given metric urn.
+   * @param currentSpec current spec for the component. empty if not exist.
+   * @param tuningWindow the tuning window
+   * @param metricUrn the metric urn to tune. When detection runs,the tuned spec will be used for detection
+   *                  to run on this metric urn.
+   * @return the specs for the component it's tuning. Will be used to initialize the tuned component when detection runs.
    */
-  Map<String, Object> tune(Map<String, Object> currentSpec, Interval trainingWindow);
+  Map<String, Object> tune(Map<String, Object> currentSpec, Interval tuningWindow, String metricUrn);
 }
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/yaml/CompositePipelineConfigTranslator.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/yaml/CompositePipelineConfigTranslator.java
index ccb2f0a..00b3a7c 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/yaml/CompositePipelineConfigTranslator.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/yaml/CompositePipelineConfigTranslator.java
@@ -408,7 +408,8 @@ public class CompositePipelineConfigTranslator extends YamlDetectionConfigTransl
         this.existingComponentSpecs.containsKey(componentName) ? MapUtils.getMap(this.existingComponentSpecs,
             componentName) : Collections.emptyMap();
 
-    return tunable.tune(existingComponentSpec, window);
+    // TODO: if dimension drill down applied, pass in the metric urn of top dimension
+    return tunable.tune(existingComponentSpec, window, this.metricUrn);
   }
 
   private Tunable getTunable(String componentClassName, Map<String, Object> params, InputDataFetcher dataFetcher)


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