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 long
LEDGER_INFO_CACHING_TIME_MINUTES
(package private) static long
NOT_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) void
cancelWaitForLastAddConfirmedUpdate(Watcher<LastAddConfirmedUpdateNotification> watcher)
void
close()
io.netty.buffer.ByteBuf
getExplicitLac()
(package private) long
getLastAddConfirmed()
(package private) boolean
isStale()
(package private) void
notifyWatchers(long lastAddConfirmed)
void
setExplicitLac(io.netty.buffer.ByteBuf lac)
(package private) long
setLastAddConfirmed(long lac)
(package private) boolean
waitForLastAddConfirmedUpdate(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:
close
in interfacejava.lang.AutoCloseable
-
-