frankmu commented on code in PR #2888:
URL: https://github.com/apache/helix/pull/2888#discussion_r1735545579


##########
helix-core/src/main/java/org/apache/helix/controller/dataproviders/ResourceControllerDataProvider.java:
##########
@@ -583,6 +587,38 @@ public Set<CapacityNode> getSimpleCapacitySet() {
     return _simpleCapacitySet;
   }
 
+  public void populateSimpleCapacitySetUsage(final Set<String> resourceNameSet,
+      final CurrentStateOutput currentStateOutput) {
+    Map<String, LiveInstance> instanceMap = getLiveInstances();
+    // Convert the assignableNodes to map for quick lookup
+    Map<String, CapacityNode> simpleCapacityMap =
+        
_simpleCapacitySet.stream().collect(Collectors.toMap(CapacityNode::getId, node 
-> node));

Review Comment:
   > Also, will this update the _simpleCapacitySet when you update the map? It 
is tmp object, right?
   
   It's tmp object acts as dictionary to quickly lookup the `CapacityNode` by 
name in the set, it won't update `_simpleCapacitySet`



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