Class LedgerEntriesImpl
java.lang.Object
org.apache.bookkeeper.client.impl.LedgerEntriesImpl
- All Implemented Interfaces:
AutoCloseable,Iterable<LedgerEntry>,LedgerEntries
Ledger entries implementation. It is a simple wrap of a list of ledger entries.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close to release the resources held by this instance.static LedgerEntriesImplcreate(List<LedgerEntry> entries) Create ledger entries.getEntry(long entryId) Gets a specific LedgerEntry by entryId.iterator()Get an iterator over all the ledger entries contained in the LedgerEntries object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
create
Create ledger entries.- Parameters:
entries- the entries with ordering- Returns:
- the LedgerEntriesImpl
-
getEntry
Gets a specific LedgerEntry by entryId.- Specified by:
getEntryin interfaceLedgerEntries- Parameters:
entryId- the LedgerEntry id- Returns:
- the LedgerEntry, null if no LedgerEntry with such entryId
-
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
LedgerEntries.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 viaLedgerEntries.close().- Specified by:
iteratorin interfaceIterable<LedgerEntry>- Specified by:
iteratorin interfaceLedgerEntries- Returns:
- an iterator of LedgerEntry objects
-
close
public void close()Description copied from interface:LedgerEntriesClose to release the resources held by this instance.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceLedgerEntries
-