junkaixue commented on code in PR #2615:
URL: https://github.com/apache/helix/pull/2615#discussion_r1325349306


##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/DelayedAutoRebalancer.java:
##########
@@ -194,6 +200,17 @@ public IdealState computeNewIdealState(String resourceName,
     return idealState;
   }
 
+  private static List<String> filterOutOnOperationInstances(Map<String, 
InstanceConfig> instanceConfigMap,
+      Set<String> nodes) {
+    return  nodes.stream()
+        .filter(instance ->
+            !(instanceConfigMap.get(instance).getInstanceOperation().equals(
+            InstanceConstants.InstanceOperation.EVACUATE.name())||
+            instanceConfigMap.get(instance).getInstanceOperation().equals(
+            InstanceConstants.InstanceOperation.SWAP_IN.name())))
+        .collect(Collectors.toList());

Review Comment:
   For simplicity, can we have a Set<InstanceOperation> and just check the 
Set.contains(instanceOperation)?
   
   It is not scalable if you add more operations and the code looks huge.



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