You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/07/14 22:00:52 UTC

[GitHub] [helix] NealSun96 commented on a change in pull request #1151: Fix enableWagedRebalance by respecting resource names argument

NealSun96 commented on a change in pull request #1151:
URL: https://github.com/apache/helix/pull/1151#discussion_r454670893



##########
File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
##########
@@ -1861,23 +1861,25 @@ public boolean enableWagedRebalance(String clusterName, List<String> resourceNam
     HelixDataAccessor accessor =
         new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<>(_zkClient));
     PropertyKey.Builder keyBuilder = accessor.keyBuilder();
-    List<IdealState> idealStates = accessor.getChildValues(keyBuilder.idealStates(), true);
+    List<IdealState> idealStates = new ArrayList<>();
+    List<PropertyKey> idealStateKeys = new ArrayList<>();
     List<String> nullIdealStates = new ArrayList<>();
-    for (int i = 0; i < idealStates.size(); i++) {
-      if (idealStates.get(i) == null) {
-        nullIdealStates.add(resourceNames.get(i));
+    for (String resourceName : resourceNames) {
+      PropertyKey key = keyBuilder.idealStates(resourceName);
+      IdealState idealState = accessor.getProperty(key);

Review comment:
       I agree, okay. 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org