Package org.apache.bookkeeper.client.api
Interface LedgerEntries
- All Superinterfaces:
AutoCloseable,Iterable<LedgerEntry>
- All Known Implementing Classes:
LedgerEntriesImpl
Interface to wrap a sequence of entries.
- Since:
- 4.6
-
Method Summary
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getEntry
Gets a specific LedgerEntry by entryId.- Parameters:
entryId- the LedgerEntry id- Returns:
- the LedgerEntry, null if no LedgerEntry with such entryId
-
iterator
Iterator<LedgerEntry> iterator()Get an iterator over all the ledger entries contained in the LedgerEntries object.Calling this method does not modify the reference count of the ByteBuf in the returned LedgerEntry objects. The caller who calls
iterator()should make sure that they do not call ByteBuf.release() on the LedgerEntry objects to avoid a double free. All reference counts will be decremented when the containing LedgerEntries object is closed viaclose().- Specified by:
iteratorin interfaceIterable<LedgerEntry>- Returns:
- an iterator of LedgerEntry objects
-
close
void close()Close to release the resources held by this instance.- Specified by:
closein interfaceAutoCloseable
-