jiajunwang commented on a change in pull request #1151:
URL: https://github.com/apache/helix/pull/1151#discussion_r454664554
##########
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<>();
Review comment:
I don't think we need this list, just throw the exception on the first
null IS.
##########
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:
The original batch call is more efficient. Why do we want to change it?
You can still iterate the returned IS list but filter by the resourceNames
list. Then check if any item in the resourceNames but not in the returned IS
list.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]