Interface LedgerEntries

All Superinterfaces:
AutoCloseable, Iterable<LedgerEntry>
All Known Implementing Classes:
LedgerEntriesImpl

public interface LedgerEntries extends AutoCloseable, Iterable<LedgerEntry>
Interface to wrap a sequence of entries.
Since:
4.6
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close to release the resources held by this instance.
    getEntry(long entryId)
    Gets a specific LedgerEntry by entryId.
    Get an iterator over all the ledger entries contained in the LedgerEntries object.

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • getEntry

      LedgerEntry getEntry(long entryId)
      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 via close().

      Specified by:
      iterator in interface Iterable<LedgerEntry>
      Returns:
      an iterator of LedgerEntry objects
    • close

      void close()
      Close to release the resources held by this instance.
      Specified by:
      close in interface AutoCloseable