ivankelly commented on a change in pull request #1573: LedgerManager should 
return the metadata just written
URL: https://github.com/apache/bookkeeper/pull/1573#discussion_r206459810
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java
 ##########
 @@ -245,15 +245,15 @@ public void process(WatchedEvent event) {
 
     @Override
     public void createLedgerMetadata(final long ledgerId, final LedgerMetadata 
metadata,
-            final GenericCallback<Void> ledgerCb) {
+            final GenericCallback<LedgerMetadata> ledgerCb) {
         String ledgerPath = getLedgerPath(ledgerId);
         StringCallback scb = new StringCallback() {
             @Override
             public void processResult(int rc, String path, Object ctx, String 
name) {
                 if (rc == Code.OK.intValue()) {
                     // update version
                     metadata.setVersion(new LongVersion(0));
-                    ledgerCb.operationComplete(BKException.Code.OK, null);
+                    ledgerCb.operationComplete(BKException.Code.OK, metadata);
 
 Review comment:
   It doesn't really do anything right now, as it's just returning what was 
passed in. Once immutable metadata is there, this will be something like.
   
   ```
   LedgerMetadata writtenMetadata = 
LedgerMetadataBuilder.from(metadata).withVersion(new LongVersion(0)).build();
   ledgerCb.operationComplete(BKException.Code.OK, writtenMetadata);
   ````

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to