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 8fa9ebe18c..b521ddd201 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 @@
  */
 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 ccb2f0a6ce..00b3a7c13b 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 @@ private void buildComponentSpec(Map<String, Object> 
yamlConfig, String type, Str
         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)


With regards,
Apache Git Services

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

Reply via email to