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 2019/02/09 01:30:05 UTC

[GitHub] sijie commented on a change in pull request #1931: (WIP) GetListOfEntriesOfLedger implementation

sijie commented on a change in pull request #1931: (WIP) GetListOfEntriesOfLedger implementation
URL: https://github.com/apache/bookkeeper/pull/1931#discussion_r255280628
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorage.java
 ##########
 @@ -248,4 +248,20 @@ default boolean isInForceGC() {
     default List<GarbageCollectionStatus> getGarbageCollectionStatus() {
         return Collections.emptyList();
     }
+
+    /**
+     * Returns the list of entries of the ledger, stored in this LedgerStorage
+     * in an encoded format as described in AvailabilityOfEntriesOfLedger class
+     * description. The returned list provide weakly consistent state of the
+     * ledger. It is guaranteed that entries of the ledger added to this
+     * LedgerStorage by the time this method is called will be available but
+     * modifications made after method invocation may not be available.
+     *
+     * @param ledgerId
+     *            - id of the ledger
+     * @return the list of entries of the ledger available in this
+     *         ledgerstorage.
+     * @throws Exception
+     */
+    byte[] getEntriesOfLedger(long ledgerId) throws Exception;
 
 Review comment:
   I would suggest returning a stream/iterator of entries. The encoding should be separated from LedgerStorage implementation.

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