akshayrai commented on a change in pull request #4250: SoC - Separate out
Tuning from Translator
URL: https://github.com/apache/incubator-pinot/pull/4250#discussion_r289062643
##########
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:
Sorry, did I miss something! Are you talking about merging the 2 sequential
loops on `componentSpecs` or the 2 nested loops?
My earlier comment was addressed assuming the former case. I am still not
convinced even if it is the latter case. Note that the two loops are on
`componentSpecs` and `componentSpec`. The parent loop iterates over each
component and the nested loop iterates over the specifications of each
component.
I do not have a complete understanding of the reference logic here either.
Nevertheless, if required I will make this change in a separate PR as it is
unrelated to this change.
----------------------------------------------------------------
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]