Class LedgerMetadataIndex

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

    public class LedgerMetadataIndex
    extends java.lang.Object
    implements java.io.Closeable
    Maintains an index for the ledgers metadata.

    The key is the ledgerId and the value is the DbLedgerStorageDataFormats.LedgerData content.

    • 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
      • delete

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

        public java.lang.Iterable<java.lang.Long> getActiveLedgersInRange​(long firstLedgerId,
                                                                          long lastLedgerId)
                                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • setFenced

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

        public boolean setLimbo​(long ledgerId)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • clearLimbo

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

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

        public void flush()
                   throws java.io.IOException
        Flushes all pending changes.
        Throws:
        java.io.IOException
      • removeDeletedLedgers

        public void removeDeletedLedgers()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getStorageStateFlags

        int getStorageStateFlags()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • setStorageStateFlags

        boolean setStorageStateFlags​(int expected,
                                     int newFlags)
                              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