lordcheng10 commented on a change in pull request #2947:
URL: https://github.com/apache/bookkeeper/pull/2947#discussion_r774942934



##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/zk/ZKMetadataDriverBase.java
##########
@@ -260,6 +268,46 @@ public synchronized LedgerManagerFactory 
getLedgerManagerFactory()
         return lmFactory;
     }
 
+    public CompletableFuture<Void> disableHealthCheck() {
+        CompletableFuture<Void> createResult = new CompletableFuture<>();
+        try {
+            zk.create(disableHealthCheckPath, 
BookKeeperConstants.EMPTY_BYTE_ARRAY, acls, CreateMode.PERSISTENT);

Review comment:
       fixed method :
   
   `   public CompletableFuture<Void> disableHealthCheck() {
           CompletableFuture<Void> createResult = new CompletableFuture<>();
           zk.create(disableHealthCheckPath, 
BookKeeperConstants.EMPTY_BYTE_ARRAY, acls, CreateMode.PERSISTENT, new 
AsyncCallback.StringCallback() {
               @Override
               public void processResult(int rc, String path, Object ctx, 
String name) {
                   if (KeeperException.Code.OK.intValue() == rc) {
                       createResult.complete(null);
                   } else if (KeeperException.Code.NODEEXISTS.intValue() == rc) 
{
                       log.debug("health check already disable!");
                       createResult.complete(null);
                   } else {
                       
createResult.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc),
 path));
                   }
               }
           }, null);
   
           return createResult;
       }`




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to