pkuwm commented on a change in pull request #838: Make ConfigAccessor and 
ZkUtil realm-aware
URL: https://github.com/apache/helix/pull/838#discussion_r386708806
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZKUtil.java
 ##########
 @@ -92,15 +97,17 @@ public static boolean isClusterSetup(String clusterName, 
HelixZkClient zkClient)
     requiredPaths.add(PropertyPathBuilder.controllerHistory(clusterName));
     boolean isValid = true;
 
-    BaseDataAccessor<Object> baseAccessor = new 
ZkBaseDataAccessor<Object>(zkClient);
-    boolean[] ret = baseAccessor.exists(requiredPaths, 0);
+    boolean[] ret = new boolean[requiredPaths.size()];
+    for (int i = 0; i < requiredPaths.size(); i++) {
+      ret[i] = zkClient.exists(requiredPaths.get(i));
+    }
     StringBuilder errorMsg = new StringBuilder();
 
     for (int i = 0; i < ret.length; i++) {
       if (!ret[i]) {
         isValid = false;
-        errorMsg
-            .append(("Invalid cluster setup, missing znode path: " + 
requiredPaths.get(i)) + "\n");
+        errorMsg.append("Invalid cluster setup, missing znode path: 
").append(requiredPaths.get(i))
 
 Review comment:
   Nit: Maybe we can modify a bit for the error message to combine the error 
paths together like below to avoid the extra duplicate strings `Invalid cluster 
setup, missing znode path` for each path.
   ```
   Invalid cluster setup, missing znode paths: [path1, path2]
   ```

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to