Package org.apache.bookkeeper.client
Class PendingReadOp
- java.lang.Object
-
- org.apache.bookkeeper.client.ReadOpBase
-
- org.apache.bookkeeper.client.PendingReadOp
-
- All Implemented Interfaces:
java.lang.Runnable,BookkeeperInternalCallbacks.ReadEntryCallback
- Direct Known Subclasses:
ListenerBasedPendingReadOp
class PendingReadOp extends ReadOpBase implements BookkeeperInternalCallbacks.ReadEntryCallback
Sequence of entries of a ledger that represents a pending read operation. When all the data read has come back, the application callback is called. This class could be improved because we could start pushing data to the application as soon as it arrives rather than waiting for the whole thing.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classPendingReadOp.ParallelReadRequest(package private) classPendingReadOp.SequenceReadRequest(package private) classPendingReadOp.SingleLedgerEntryRequest-
Nested classes/interfaces inherited from class org.apache.bookkeeper.client.ReadOpBase
ReadOpBase.LedgerEntryRequest, ReadOpBase.ReadContext
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanparallelReadprotected java.util.LinkedList<PendingReadOp.SingleLedgerEntryRequest>seq-
Fields inherited from class org.apache.bookkeeper.client.ReadOpBase
allowFailFast, clientCtx, complete, endEntryId, future, heardFromHosts, heardFromHostsBitSet, isRecoveryRead, lh, numPendingEntries, requestTimeNanos, requiredBookiesMissingEntryForRecovery, sentToHosts, speculativeTask, startEntryId
-
-
Constructor Summary
Constructors Constructor Description PendingReadOp(LedgerHandle lh, ClientContext clientCtx, long startEntryId, long endEntryId, boolean isRecoveryRead)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidinitiate()(package private) PendingReadOpparallelRead(boolean enabled)voidreadEntryComplete(int rc, long ledgerId, long entryId, io.netty.buffer.ByteBuf buffer, java.lang.Object ctx)(package private) voidsendReadTo(int bookieIndex, BookieId to, PendingReadOp.SingleLedgerEntryRequest entry)protected voidsubmitCallback(int code)-
Methods inherited from class org.apache.bookkeeper.client.ReadOpBase
allowFailFastOnUnwritableChannel, cancelSpeculativeTask, future, getLedgerMetadata, getSpeculativeTask, run, submit
-
-
-
-
Field Detail
-
parallelRead
protected boolean parallelRead
-
seq
protected final java.util.LinkedList<PendingReadOp.SingleLedgerEntryRequest> seq
-
-
Constructor Detail
-
PendingReadOp
PendingReadOp(LedgerHandle lh, ClientContext clientCtx, long startEntryId, long endEntryId, boolean isRecoveryRead)
-
-
Method Detail
-
parallelRead
PendingReadOp parallelRead(boolean enabled)
-
initiate
void initiate()
- Specified by:
initiatein classReadOpBase
-
readEntryComplete
public void readEntryComplete(int rc, long ledgerId, long entryId, io.netty.buffer.ByteBuf buffer, java.lang.Object ctx)- Specified by:
readEntryCompletein interfaceBookkeeperInternalCallbacks.ReadEntryCallback
-
submitCallback
protected void submitCallback(int code)
- Specified by:
submitCallbackin classReadOpBase
-
sendReadTo
void sendReadTo(int bookieIndex, BookieId to, PendingReadOp.SingleLedgerEntryRequest entry) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
-