Class LedgerEntryPage

  • All Implemented Interfaces:
    java.lang.AutoCloseable

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

      • LedgerEntryPage

        public LedgerEntryPage​(int pageSize,
                               int entriesPerPage)
      • LedgerEntryPage

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

      • getIndexEntrySize

        public static int getIndexEntrySize()
      • resetPage

        public void resetPage()
      • markDeleted

        public void markDeleted()
      • isDeleted

        public boolean isDeleted()
      • toString

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

        public void usePage()
      • releasePageNoCallback

        public void releasePageNoCallback()
      • releasePage

        public void releasePage()
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.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 java.io.IOException
        Throws:
        java.io.IOException
      • getPageToWrite

        public java.nio.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 java.lang.Exception
        Iterates over non-empty entry mappings.
        Parameters:
        vis - Consumer for entry position pairs.
        Throws:
        java.lang.Exception
      • getEntriesIterator

        public java.util.PrimitiveIterator.OfLong getEntriesIterator()
      • close

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