sijie commented on a change in pull request #510: Issue-605 BP-15 New 
CreateLedger API
URL: https://github.com/apache/bookkeeper/pull/510#discussion_r143028801
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
 ##########
 @@ -968,6 +1034,28 @@ public void readLastConfirmedDataComplete(int rc, 
DigestManager.RecoveryData dat
         new TryReadLastConfirmedOp(this, innercb, 
getLastAddConfirmed()).initiate();
     }
 
+    @Override
+    public CompletableFuture<Long> tryReadLastAddConfirmed() {
+        CompletableFuture<Long> result = new CompletableFuture<>();
+
+        ReadLastConfirmedCallback callback = (int rc, long lastConfirmed, 
Object ctx) -> {
+            SyncCallbackUtils.finish(rc, lastConfirmed, result);
+        };
+        asyncTryReadLastConfirmed(callback, result);
+        return result;
+    }
+
+    @Override
+    public CompletableFuture<Long> readLastAddConfirmed() {
+        CompletableFuture<Long> result = new CompletableFuture<>();
+
+        ReadLastConfirmedCallback callback = (int rc, long lastConfirmed, 
Object ctx) -> {
 
 Review comment:
   ReadLastConfirmedCallback in line 1041 and line 1053 seem to be same. Can we 
follow the same pattern as how we handle other callbacks?
 
----------------------------------------------------------------
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