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 2017/11/03 17:23:24 UTC

[GitHub] sijie opened a new issue #693: Define a LedgerEntries interface for read entries

sijie opened a new issue #693: Define a LedgerEntries interface for read entries
URL: https://github.com/apache/bookkeeper/issues/693
 
 
   
   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   
   In the new API proposed in #506 , we return `Iterable<LedgerEntry>` for read entries. It is a bit problematic when returning multiple iterators and have no ability to release the entry buffers hold by ledger entries.
   
   I am proposing introducing a `LedgerEntries` interface for wrapping the entries.
   
   ```
   interface LedgerEntries extends Iterable<LedgerEntry>, AutoCloseable {
   
          long getEntry(long entryId);
   
          Iterator<LedgerEntry> iterator();
   
   }
   ```
   
   so:
   
   - the implementation can increase the reference of the buffers when creating an iterator
   - we can make `LedgerEntries` a recycle object, and it is returned to the pool when #close() is called.
   - on #close(), it also releases all the references to release resources.
   
   2. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?
   
   *blocker* for `4.6.0` release.
   
   3. Provide any additional detail on your proposed use case for this feature.
   
   N/A

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