himanshukandwal commented on code in PR #2649:
URL: https://github.com/apache/helix/pull/2649#discussion_r1363369703


##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/WagedInstanceCapacity.java:
##########
@@ -130,28 +136,29 @@ public void 
processPendingMessages(ResourceControllerDataProvider cache,
     }
   }
 
-
-  private void processCurrentState(ResourceControllerDataProvider cache,
-      CurrentStateOutput currentStateOutput, Map<String, Resource> resourceMap,
-      WagedResourceWeightsProvider weightProvider) {
+  void processCurrentState(ResourceControllerDataProvider cache,
+      CurrentStateOutput currentStateOutput, Map<String, Resource> 
resourceMap) {
 
     // Iterate through all the resources
     for (Map.Entry<String, Resource> entry : resourceMap.entrySet()) {
       String resName = entry.getKey();
       Resource resource = entry.getValue();
 
-      // if Resource is WAGED managed, then we need to manage the capacity.
-      if (!WagedValidationUtil.isWagedEnabled(cache.getIdealState(resName))) {
-        continue;
-      }
-
       // list of partitions in the resource
       Collection<Partition> partitions = resource.getPartitions();
 
+      // calculate merge resource-config one for each resource.
+      ResourceConfig resourceConfig = cache.getResourceConfig(resName);
+      IdealState is = cache.getIdealState(resName);
+      ResourceConfig mergedResourceConfig =
+          ResourceConfig.mergeIdealStateWithResourceConfig(resourceConfig, is);

Review Comment:
   Yes, this merge operation is not needed as partition capacity map is 
directly present in the ResourceConfig. I have also updated this in 
`WagedResourceWeightsProvider`. Thanks!



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