Class EntryLocationIndex

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class EntryLocationIndex
    extends java.lang.Object
    implements java.io.Closeable
    Maintains an index of the entry locations in the EntryLogger.

    For each ledger multiple entries are stored in the same "record", represented by the LedgerIndexPage class.

    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • getLocation

        public long getLocation​(long ledgerId,
                                long entryId)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getLastEntryInLedger

        public long getLastEntryInLedger​(long ledgerId)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • addLocation

        public void addLocation​(long ledgerId,
                                long entryId,
                                long location)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • addLocation

        public void addLocation​(KeyValueStorage.Batch batch,
                                long ledgerId,
                                long entryId,
                                long location)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • updateLocations

        public void updateLocations​(java.lang.Iterable<EntryLocation> newLocations)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • delete

        public void delete​(long ledgerId)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getEntryLocationDBPath

        public java.lang.String getEntryLocationDBPath()
      • compact

        public void compact()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • isCompacting

        public boolean isCompacting()
      • removeOffsetFromDeletedLedgers

        public void removeOffsetFromDeletedLedgers()
                                            throws java.io.IOException
        Throws:
        java.io.IOException