You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/02/05 19:01:13 UTC

[GitHub] sijie commented on issue #1121: [Merge Yahoo repo]: AsyncReadLastEntry should trigger callback with error when ledger is empty

sijie commented on issue #1121: [Merge Yahoo repo]: AsyncReadLastEntry should trigger callback with error when ledger is empty
URL: https://github.com/apache/bookkeeper/pull/1121#issuecomment-363186519
 
 
   @jiazhai I think this cherry-pick is not correct.
   
   You need to cherry-pick changes in 372a99db49
   
   ```
   diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
   index 33e7af09b..885dda7ae 100644
   --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
   +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
   @@ -460,13 +460,30 @@ public class LedgerHandle {
                return;
            }
   
   -        asyncReadEntriesInternal(firstEntry, lastEntry, cb, ctx);
   +        asyncReadEntriesInternal(firstEntry, lastEntry, cb, ctx, false);
        }
   
   -    void asyncReadEntriesInternal(long firstEntry, long lastEntry, ReadCallback cb, Object ctx) {
   +    /**
   +     * Read the last entry in the ledger
   +     *
   +     * @param cb
   +     *            object implementing read callback interface
   +     * @param ctx
   +     *            control object
   +     */
   +    public void asyncReadLastEntry(ReadCallback cb, Object ctx) {
   +        long lastEntryId = getLastAddConfirmed();
   +        asyncReadEntriesInternal(lastEntryId, lastEntryId, cb, ctx, true);
   +    }
   ```
   
   when you cherry-picked 372a99db49, please add a sync call of `asyncReadLastEntry`, and create an issue for adding this method into new ledger api.
   
   Then cherry-pick 9560ab0f92
   
   

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


With regards,
Apache Git Services