GrantPSpencer commented on code in PR #2653:
URL: https://github.com/apache/helix/pull/2653#discussion_r1355447583


##########
helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/ResourceAssignmentOptimizerAccessor.java:
##########
@@ -359,8 +359,10 @@ private void computeWagedAssignmentResult(List<IdealState> 
wagedResourceIdealSta
     ConfigAccessor cfgAccessor = getConfigAccessor();
     List<ResourceConfig> wagedResourceConfigs = new ArrayList<>();
     for (IdealState idealState : wagedResourceIdealState) {
-      wagedResourceConfigs
-          .add(cfgAccessor.getResourceConfig(clusterId, 
idealState.getResourceName()));
+      ResourceConfig resourceConfig = cfgAccessor.getResourceConfig(clusterId, 
idealState.getResourceName());

Review Comment:
   The check for WAGED resources happens in the function 
(computeOptimalAssignmentForResources) that calls this function 
(computeWagedAssignmentResult). My understanding is there is an assumption that 
the only resources passed to it are waged resources.
   
   The calling function is computeOptimalAssignmentForResources() in 
ResourceAssignmentOptimizerAccessor line 254
   ```
         // Compute all Waged resources in a batch later.
         if (idealState.getRebalancerClassName() != null && 
idealState.getRebalancerClassName()
             .equals(WagedRebalancer.class.getName())) {
           wagedResourceIdealState.add(idealState);
           continue;
         }
   ```
   
   and then:
   
   ```
       if (!wagedResourceIdealState.isEmpty()) {
         computeWagedAssignmentResult(wagedResourceIdealState, inputFields, 
clusterState, clusterId,
             result);
       }
   ```



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