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_r288647806
##########
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:
Can we combine the two for loops?
----------------------------------------------------------------
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]