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 Summary
FieldsModifier and TypeFieldDescription(package private) static final long(package private) static final long -
Constructor Summary
ConstructorsConstructorDescriptionTransientLedgerInfo(long ledgerId, LedgerMetadataIndex ledgerIndex) Construct an Watchable with zero watchers. -
Method Summary
Modifier and TypeMethodDescription(package private) voidvoidclose()io.netty.buffer.ByteBuf(package private) long(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 Details
-
LEDGER_INFO_CACHING_TIME_MINUTES
static final long LEDGER_INFO_CACHING_TIME_MINUTES- See Also:
-
NOT_ASSIGNED_LAC
static final long NOT_ASSIGNED_LAC- See Also:
-
-
Constructor Details
-
TransientLedgerInfo
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:
closein interfaceAutoCloseable
-