You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2021/03/10 09:52:58 UTC

[GitHub] [zookeeper] arshadmohammad commented on a change in pull request #1626: ZOOKEEPER-1871: Add an option to zkCli to wait for connection before executing commands

arshadmohammad commented on a change in pull request #1626:
URL: https://github.com/apache/zookeeper/pull/1626#discussion_r591291428



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java
##########
@@ -249,6 +261,17 @@ protected void connectToZK(String newHost) throws InterruptedException, IOExcept
             System.setProperty(ZKClientConfig.SECURE_CLIENT, "true");
             System.out.println("Secure connection is enabled");
         }
+        if (cl.getOption("waitforconnection") != null) {
+            connectLatch = new CountDownLatch(1);
+        }
+        int timeout = Integer.parseInt(cl.getOption("timeout"));
+        zk = new ZooKeeperAdmin(host, timeout, new MyWatcher(), readOnly);

Review comment:
       No need to create ZooKeeperAdmin twice.
   Also move all these changes after line number 289




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