xiaohui-sun commented on a change in pull request #4250: SoC - Separate out 
Tuning from Translator
URL: https://github.com/apache/incubator-pinot/pull/4250#discussion_r288782520
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionPipeline.java
 ##########
 @@ -90,22 +90,21 @@ private void initComponents() throws Exception {
     Map<String, BaseComponent> instancesMap = config.getComponents();
     Map<String, Object> componentSpecs = config.getComponentSpecs();
     if (componentSpecs != null) {
-      for (String componentName : componentSpecs.keySet()) {
-        Map<String, Object> componentSpec = MapUtils.getMap(componentSpecs, 
componentName);
-        if (!instancesMap.containsKey(componentName)){
-          instancesMap.put(componentName, createComponent(componentSpec));
+      for (String componentKey : componentSpecs.keySet()) {
+        Map<String, Object> componentSpec = MapUtils.getMap(componentSpecs, 
componentKey);
+        if (!instancesMap.containsKey(componentKey)){
+          instancesMap.put(componentKey, createComponent(componentSpec));
         }
       }
 
-      for (String componentName : componentSpecs.keySet()) {
-        Map<String, Object> componentSpec = MapUtils.getMap(componentSpecs, 
componentName);
+      for (String componentKey : componentSpecs.keySet()) {
 
 Review comment:
   You can do  update right after inserting.
   for (String componentKey : componentSpecs.keySet()) {
   // check if key exists
   // if not then insert (key, value)
   // update the map (value)
   }

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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