Class TransientLedgerInfo

java.lang.Object
org.apache.bookkeeper.common.util.Watchable<LastAddConfirmedUpdateNotification>
org.apache.bookkeeper.bookie.storage.ldb.TransientLedgerInfo
All Implemented Interfaces:
AutoCloseable, Recyclable

class TransientLedgerInfo extends Watchable<LastAddConfirmedUpdateNotification> implements AutoCloseable
This class borrows the logic from FileInfo.

This class is used for holding all the transient states for a given ledger.

  • Field Details

  • Constructor Details

    • TransientLedgerInfo

      public TransientLedgerInfo(long ledgerId, LedgerMetadataIndex ledgerIndex)
      Construct an Watchable with zero watchers.
  • Method Details

    • getLastAddConfirmed

      long getLastAddConfirmed()
    • setLastAddConfirmed

      long setLastAddConfirmed(long lac)
    • waitForLastAddConfirmedUpdate

      boolean waitForLastAddConfirmedUpdate(long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher) throws IOException
      Throws:
      IOException
    • cancelWaitForLastAddConfirmedUpdate

      void cancelWaitForLastAddConfirmedUpdate(Watcher<LastAddConfirmedUpdateNotification> watcher) throws IOException
      Throws:
      IOException
    • getExplicitLac

      public io.netty.buffer.ByteBuf getExplicitLac()
    • setExplicitLac

      public void setExplicitLac(io.netty.buffer.ByteBuf lac)
    • isStale

      boolean isStale()
    • notifyWatchers

      void notifyWatchers(long lastAddConfirmed)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable