Class TransientLedgerInfo
- java.lang.Object
-
- org.apache.bookkeeper.common.util.Watchable<LastAddConfirmedUpdateNotification>
-
- org.apache.bookkeeper.bookie.storage.ldb.TransientLedgerInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable,Recyclable
class TransientLedgerInfo extends Watchable<LastAddConfirmedUpdateNotification> implements java.lang.AutoCloseable
This class borrows the logic from FileInfo.This class is used for holding all the transient states for a given ledger.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static longLEDGER_INFO_CACHING_TIME_MINUTES(package private) static longNOT_ASSIGNED_LAC
-
Constructor Summary
Constructors Constructor Description TransientLedgerInfo(long ledgerId, LedgerMetadataIndex ledgerIndex)Construct an Watchable with zero watchers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcancelWaitForLastAddConfirmedUpdate(Watcher<LastAddConfirmedUpdateNotification> watcher)voidclose()io.netty.buffer.ByteBufgetExplicitLac()(package private) longgetLastAddConfirmed()(package private) booleanisStale()(package private) voidnotifyWatchers(long lastAddConfirmed)voidsetExplicitLac(io.netty.buffer.ByteBuf lac)(package private) longsetLastAddConfirmed(long lac)(package private) booleanwaitForLastAddConfirmedUpdate(long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher)-
Methods inherited from class org.apache.bookkeeper.common.util.Watchable
addWatcher, deleteWatcher, deleteWatchers, notifyWatchers, recycle
-
-
-
-
Field Detail
-
LEDGER_INFO_CACHING_TIME_MINUTES
static final long LEDGER_INFO_CACHING_TIME_MINUTES
- See Also:
- Constant Field Values
-
NOT_ASSIGNED_LAC
static final long NOT_ASSIGNED_LAC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TransientLedgerInfo
public TransientLedgerInfo(long ledgerId, LedgerMetadataIndex ledgerIndex)Construct an Watchable with zero watchers.
-
-
Method Detail
-
getLastAddConfirmed
long getLastAddConfirmed()
-
setLastAddConfirmed
long setLastAddConfirmed(long lac)
-
waitForLastAddConfirmedUpdate
boolean waitForLastAddConfirmedUpdate(long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher) throws java.io.IOException- Throws:
java.io.IOException
-
cancelWaitForLastAddConfirmedUpdate
void cancelWaitForLastAddConfirmedUpdate(Watcher<LastAddConfirmedUpdateNotification> watcher) throws java.io.IOException
- Throws:
java.io.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:
closein interfacejava.lang.AutoCloseable
-
-