zhaijack commented on a change in pull request #936: Issue 897: un-bind 
zookeeper from bookkeeper admin
URL: https://github.com/apache/bookkeeper/pull/936#discussion_r159361917
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java
 ##########
 @@ -1130,120 +1121,40 @@ public void processResult(int rc, String s, Object 
ctx) {
      */
     public static boolean format(ClientConfiguration conf,
             boolean isInteractive, boolean force) throws Exception {
-        ZooKeeper zkc = ZooKeeperClient.newBuilder()
-                .connectString(conf.getZkServers())
-                .sessionTimeoutMs(conf.getZkTimeout())
-                .build();
-        BookKeeper bkc = null;
-        try {
-            boolean ledgerRootExists = null != zkc.exists(
-                    conf.getZkLedgersRootPath(), false);
-            boolean availableNodeExists = null != zkc.exists(
-                    conf.getZkAvailableBookiesPath(), false);
-            List<ACL> zkAcls = ZkUtils.getACLs(conf);
-            // Create ledgers root node if not exists
-            if (!ledgerRootExists) {
-                zkc.create(conf.getZkLedgersRootPath(), "".getBytes(UTF_8),
-                        zkAcls, CreateMode.PERSISTENT);
-            }
-            // create available bookies node if not exists
-            if (!availableNodeExists) {
-                zkc.create(conf.getZkAvailableBookiesPath(), 
"".getBytes(UTF_8),
-                        zkAcls, CreateMode.PERSISTENT);
-            }
 
-            // create readonly bookies node if not exists
-            if (null == zkc.exists(conf.getZkAvailableBookiesPath() + "/" + 
READONLY, false)) {
-                zkc.create(
-                    conf.getZkAvailableBookiesPath() + "/" + READONLY,
-                    new byte[0],
-                    zkAcls,
-                    CreateMode.PERSISTENT);
-            }
+        try (RegistrationManager rm = new ZKRegistrationManager()) {
 
 Review comment:
   Thanks, will change it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to