Package org.apache.bookkeeper.client
Class PendingReadOp
java.lang.Object
org.apache.bookkeeper.client.ReadOpBase
org.apache.bookkeeper.client.PendingReadOp
- All Implemented Interfaces:
Runnable,BookkeeperInternalCallbacks.ReadEntryCallback
- Direct Known Subclasses:
ListenerBasedPendingReadOp
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 ClassesModifier and TypeClassDescription(package private) class(package private) class(package private) classNested classes/interfaces inherited from class org.apache.bookkeeper.client.ReadOpBase
ReadOpBase.LedgerEntryRequest, ReadOpBase.ReadContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final LinkedList<PendingReadOp.SingleLedgerEntryRequest>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
ConstructorsConstructorDescriptionPendingReadOp(LedgerHandle lh, ClientContext clientCtx, long startEntryId, long endEntryId, boolean isRecoveryRead) -
Method Summary
Modifier and TypeMethodDescription(package private) voidinitiate()(package private) PendingReadOpparallelRead(boolean enabled) voidreadEntryComplete(int rc, long ledgerId, long entryId, io.netty.buffer.ByteBuf buffer, 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 Details
-
parallelRead
protected boolean parallelRead -
seq
-
-
Constructor Details
-
PendingReadOp
PendingReadOp(LedgerHandle lh, ClientContext clientCtx, long startEntryId, long endEntryId, boolean isRecoveryRead)
-
-
Method Details
-
parallelRead
-
initiate
void initiate()- Specified by:
initiatein classReadOpBase
-
readEntryComplete
public void readEntryComplete(int rc, long ledgerId, long entryId, io.netty.buffer.ByteBuf buffer, 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 InterruptedException - Throws:
InterruptedException
-