sijie commented on a change in pull request #663: Issue 662: Introduce Bookie 
Registration Manager for bookie server
URL: https://github.com/apache/bookkeeper/pull/663#discussion_r147221527
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
 ##########
 @@ -261,18 +264,15 @@ int runCmd(CommandLine cmdLine) throws Exception {
             boolean result = Bookie.format(conf, interactive, force);
             // delete cookie
             if (cmdLine.hasOption("d")) {
-                ZooKeeperClient zkc =
-                        ZooKeeperClient.newBuilder()
-                                .connectString(conf.getZkServers())
-                                .sessionTimeoutMs(conf.getZkTimeout())
-                                .build();
+                RegistrationManager rm = new ZKRegistrationManager();
 
 Review comment:
   @eolivelli sorry for jumping in here. 
   
   I have this `AutoCloseable` question for a long time. why you are preferring 
`AutoCloseable` over `Closeable`? I think `Closeable` extends `AutoCloseable`. 
I saw we were changing a few places that were using `Closeable` to 
`AutoCloseable` (e.g. BookKeeper, LedgerHandle). 
https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html technically 
all the classes that implements Closeable should have AutoCloseable ability, no?
   
   regardless, I think `RegistrationManager` is already implemented using 
`AutoCloseable` in this pull request. the reason might be to keep code 
structure unchanged, so it is easier for review.

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