Package org.apache.bookkeeper.client
Class PendingReadLacOp
- java.lang.Object
-
- org.apache.bookkeeper.client.PendingReadLacOp
-
- All Implemented Interfaces:
BookkeeperInternalCallbacks.ReadLacCallback
class PendingReadLacOp extends java.lang.Object implements BookkeeperInternalCallbacks.ReadLacCallback
This represents a pending ReadLac operation.LAC is stored in two places on bookies. 1. WriteLac operation sends Explicit LAC and is stored in memory on each bookie. 2. Each AddEntry operation piggy-backs LAC which is stored on bookie's disk.
This operation returns both of those entries and we pick the latest LAC out of available answers.
This is an optional protocol operations to facilitate tailing readers to be up to date with the writer. This is best effort to get latest LAC from bookies, and doesn't affect the correctness of the protocol.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfacePendingReadLacOp.LacCallback
-
Field Summary
Fields Modifier and Type Field Description (package private) BookieClientbookieClient(package private) PendingReadLacOp.LacCallbackcb(package private) booleancompleted(package private) DistributionSchedule.QuorumCoverageSetcoverageSet(package private) java.util.List<BookieId>currentEnsemble(package private) intlastSeenError(package private) LedgerHandlelh(package private) static org.slf4j.LoggerLOG(package private) longmaxLac(package private) intnumResponsesPending
-
Constructor Summary
Constructors Constructor Description PendingReadLacOp(LedgerHandle lh, BookieClient bookieClient, java.util.List<BookieId> ensemble, PendingReadLacOp.LacCallback cb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitiate()voidreadLacComplete(int rc, long ledgerId, io.netty.buffer.ByteBuf lacBuffer, io.netty.buffer.ByteBuf lastEntryBuffer, java.lang.Object ctx)
-
-
-
Field Detail
-
LOG
static final org.slf4j.Logger LOG
-
lh
LedgerHandle lh
-
bookieClient
BookieClient bookieClient
-
numResponsesPending
int numResponsesPending
-
completed
volatile boolean completed
-
lastSeenError
int lastSeenError
-
coverageSet
final DistributionSchedule.QuorumCoverageSet coverageSet
-
maxLac
long maxLac
-
currentEnsemble
final java.util.List<BookieId> currentEnsemble
-
-
Constructor Detail
-
PendingReadLacOp
PendingReadLacOp(LedgerHandle lh, BookieClient bookieClient, java.util.List<BookieId> ensemble, PendingReadLacOp.LacCallback cb)
-
-
Method Detail
-
initiate
public void initiate()
-
readLacComplete
public void readLacComplete(int rc, long ledgerId, io.netty.buffer.ByteBuf lacBuffer, io.netty.buffer.ByteBuf lastEntryBuffer, java.lang.Object ctx)- Specified by:
readLacCompletein interfaceBookkeeperInternalCallbacks.ReadLacCallback
-
-