qqu0127 commented on code in PR #2055:
URL: https://github.com/apache/helix/pull/2055#discussion_r854564770


##########
helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/MaintenanceManagementService.java:
##########
@@ -361,13 +364,20 @@ private MaintenanceManagementInstanceInfo 
takeFreeSingleInstanceHelper(String cl
           PerInstanceAccessor.PerInstanceProperties.continueOnFailures.name();
       Map<String, Map<String, String>> operationConfigSet = new HashMap<>();
 
+      Map<String, String> commonOperationConfig =
+          (operationConfig == null || 
!operationConfig.containsKey(OPERATION_CONFIG_SHARED_INPUT))
+              ? Collections.emptyMap()
+              : 
getMapFromJsonPayload(operationConfig.get(OPERATION_CONFIG_SHARED_INPUT));
+
       // perform operation check
       for (OperationInterface operationClass : operationAbstractClassList) {
         String operationClassName = operationClass.getClass().getName();
         Map<String, String> singleOperationConfig =
             (operationConfig == null || 
!operationConfig.containsKey(operationClassName))
                 ? Collections.emptyMap()
                 : 
getMapFromJsonPayload(operationConfig.get(operationClassName));
+        commonOperationConfig
+            .forEach((key, value) -> singleOperationConfig.merge(key, value, 
(v1, v2) -> v1));

Review Comment:
   It seems we always keep the value in `singleOperationConfig`? 
   If so, could we use 
`commonOperationConfig.forEach(singleOperationConfig::putIfAbsent)`? Let's also 
add a comment here to clarify the combining logic.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to