Interface LedgerCache

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    InterleavedStorageRegenerateIndexOp.DryRunLedgerCache, LedgerCacheImpl

    public interface LedgerCache
    extends java.io.Closeable
    This class maps a ledger entry number into a location (entrylogid, offset) in an entry log file. It does user level caching to more efficiently manage disk head scheduling.
    • Method Detail

      • setFenced

        boolean setFenced​(long ledgerId)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • isFenced

        boolean isFenced​(long ledgerId)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • setMasterKey

        void setMasterKey​(long ledgerId,
                          byte[] masterKey)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • ledgerExists

        boolean ledgerExists​(long ledgerId)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • putEntryOffset

        void putEntryOffset​(long ledger,
                            long entry,
                            long offset)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getEntryOffset

        long getEntryOffset​(long ledger,
                            long entry)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • flushLedger

        void flushLedger​(boolean doAll)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getLastEntry

        long getLastEntry​(long ledgerId)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getLastAddConfirmed

        java.lang.Long getLastAddConfirmed​(long ledgerId)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • updateLastAddConfirmed

        long updateLastAddConfirmed​(long ledgerId,
                                    long lac)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • waitForLastAddConfirmedUpdate

        boolean waitForLastAddConfirmedUpdate​(long ledgerId,
                                              long previousLAC,
                                              Watcher<LastAddConfirmedUpdateNotification> watcher)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • cancelWaitForLastAddConfirmedUpdate

        void cancelWaitForLastAddConfirmedUpdate​(long ledgerId,
                                                 Watcher<LastAddConfirmedUpdateNotification> watcher)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteLedger

        void deleteLedger​(long ledgerId)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • setExplicitLac

        void setExplicitLac​(long ledgerId,
                            io.netty.buffer.ByteBuf lac)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getExplicitLac

        io.netty.buffer.ByteBuf getExplicitLac​(long ledgerId)
      • getEntriesIterator

        java.util.PrimitiveIterator.OfLong getEntriesIterator​(long ledgerId)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readLedgerIndexMetadata

        LedgerCache.LedgerIndexMetadata readLedgerIndexMetadata​(long ledgerId)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException