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_r142484973
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java
 ##########
 @@ -931,22 +945,23 @@ public void asyncCreateLedgerAdv(final int ensSize, 
final int writeQuorumSize, f
      * @throws InterruptedException
      * @throws BKException
      */
+    @SuppressWarnings("unchecked")
     public LedgerHandle createLedgerAdv(final long ledgerId,
                                         int ensSize,
                                         int writeQuorumSize,
                                         int ackQuorumSize,
                                         DigestType digestType,
                                         byte passwd[],
                                         final Map<String, byte[]> 
customMetadata) throws InterruptedException, BKException{
-        CompletableFuture<LedgerHandle> counter = new CompletableFuture<>();
+        SyncCreateCallback result = new SyncCreateCallback();
 
         /*
          * Calls asynchronous version
          */
         asyncCreateLedgerAdv(ledgerId, ensSize, writeQuorumSize, 
ackQuorumSize, digestType, passwd,
-                             new SyncCreateCallback(), counter, 
customMetadata);
+                             result, null, customMetadata);
 
-        LedgerHandle lh = SynchCallbackUtils.waitForResult(counter);
+        LedgerHandle lh = (LedgerHandle) 
SyncCallbackUtils.waitForResult(result);
 
 Review comment:
   I am not sure why do you need casting here. I see this in multiple places.
 
----------------------------------------------------------------
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