Class LedgerEntryPage

java.lang.Object
org.apache.bookkeeper.bookie.LedgerEntryPage
All Implemented Interfaces:
AutoCloseable

public class LedgerEntryPage extends Object implements AutoCloseable
This is a page in the LedgerCache. It holds the locations (entrylogfile, offset) for entry ids.
  • Constructor Details

    • LedgerEntryPage

      public LedgerEntryPage(int pageSize, int entriesPerPage)
    • LedgerEntryPage

      public LedgerEntryPage(int pageSize, int entriesPerPage, LEPStateChangeCallback callback)
  • Method Details

    • getIndexEntrySize

      public static int getIndexEntrySize()
    • resetPage

      public void resetPage()
    • markDeleted

      public void markDeleted()
    • isDeleted

      public boolean isDeleted()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • usePage

      public void usePage()
    • releasePageNoCallback

      public void releasePageNoCallback()
    • releasePage

      public void releasePage()
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setClean

      void setClean(int versionOfCleaning)
    • isClean

      boolean isClean()
    • setOffset

      public void setOffset(long offset, int position)
    • getOffset

      public long getOffset(int position)
    • zeroPage

      public void zeroPage()
    • readPage

      public void readPage(FileInfo fi) throws IOException
      Throws:
      IOException
    • getPageToWrite

      public ByteBuffer getPageToWrite()
    • getLedger

      long getLedger()
    • getVersion

      public int getVersion()
    • getEntryKey

      public EntryKey getEntryKey()
    • setLedgerAndFirstEntry

      void setLedgerAndFirstEntry(long ledgerId, long firstEntry)
    • getFirstEntry

      long getFirstEntry()
    • getMaxPossibleEntry

      long getMaxPossibleEntry()
    • getFirstEntryPosition

      long getFirstEntryPosition()
    • inUse

      public boolean inUse()
    • getLastEntry

      public long getLastEntry()
    • getEntries

      public void getEntries(LedgerEntryPage.EntryVisitor vis) throws Exception
      Iterates over non-empty entry mappings.
      Parameters:
      vis - Consumer for entry position pairs.
      Throws:
      Exception
    • getEntriesIterator

      public PrimitiveIterator.OfLong getEntriesIterator()
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception