Package org.apache.bookkeeper.client
Class BatchedReadOp.SequenceReadRequest
- java.lang.Object
-
- org.apache.bookkeeper.client.ReadOpBase.LedgerEntryRequest
-
- org.apache.bookkeeper.client.BatchedReadOp.BatchedLedgerEntryRequest
-
- org.apache.bookkeeper.client.BatchedReadOp.SequenceReadRequest
-
- All Implemented Interfaces:
SpeculativeRequestExecutor
- Enclosing class:
- BatchedReadOp
class BatchedReadOp.SequenceReadRequest extends BatchedReadOp.BatchedLedgerEntryRequest
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.BitSet
erroredReplicas
(package private) int
nextReplicaIndexToReadFrom
(package private) static int
NOT_FOUND
(package private) java.util.BitSet
sentReplicas
-
Fields inherited from class org.apache.bookkeeper.client.BatchedReadOp.BatchedLedgerEntryRequest
entries, lId, maxCount, maxSize
-
Fields inherited from class org.apache.bookkeeper.client.ReadOpBase.LedgerEntryRequest
complete, eId, ensemble, firstError, numBookiesMissingEntry, rc, writeSet
-
-
Constructor Summary
Constructors Constructor Description SequenceReadRequest(java.util.List<BookieId> ensemble, long lId, long eId, int maxCount, long maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
complete(int bookieIndex, BookieId host, ByteBufList bufList)
(package private) void
logErrorAndReattemptRead(int bookieIndex, BookieId host, java.lang.String errMsg, int rc)
Log error errMsg and reattempt read from host.(package private) BookieId
maybeSendSpeculativeRead(java.util.BitSet heardFrom)
Send to next replica speculatively, if required and possible.(package private) void
read()
Execute the read request.(package private) BookieId
sendNextRead()
-
Methods inherited from class org.apache.bookkeeper.client.BatchedReadOp.BatchedLedgerEntryRequest
toString
-
Methods inherited from class org.apache.bookkeeper.client.ReadOpBase.LedgerEntryRequest
close, fail, getRc, isComplete, issueSpeculativeRequest
-
-
-
-
Field Detail
-
NOT_FOUND
static final int NOT_FOUND
- See Also:
- Constant Field Values
-
nextReplicaIndexToReadFrom
int nextReplicaIndexToReadFrom
-
sentReplicas
final java.util.BitSet sentReplicas
-
erroredReplicas
final java.util.BitSet erroredReplicas
-
-
Constructor Detail
-
SequenceReadRequest
SequenceReadRequest(java.util.List<BookieId> ensemble, long lId, long eId, int maxCount, long maxSize)
-
-
Method Detail
-
read
void read()
Description copied from class:ReadOpBase.LedgerEntryRequest
Execute the read request.- Specified by:
read
in classReadOpBase.LedgerEntryRequest
-
maybeSendSpeculativeRead
BookieId maybeSendSpeculativeRead(java.util.BitSet heardFrom)
Description copied from class:ReadOpBase.LedgerEntryRequest
Send to next replica speculatively, if required and possible. This returns the host we may have sent to for unit testing.- Specified by:
maybeSendSpeculativeRead
in classReadOpBase.LedgerEntryRequest
- Parameters:
heardFrom
- the set of hosts that we already received responses.- Returns:
- host we sent to if we sent. null otherwise.
-
sendNextRead
BookieId sendNextRead()
-
logErrorAndReattemptRead
void logErrorAndReattemptRead(int bookieIndex, BookieId host, java.lang.String errMsg, int rc)
Description copied from class:ReadOpBase.LedgerEntryRequest
Log error errMsg and reattempt read from host.- Overrides:
logErrorAndReattemptRead
in classReadOpBase.LedgerEntryRequest
- Parameters:
bookieIndex
- bookie indexhost
- host that just responderrMsg
- error msg to logrc
- read result code
-
complete
boolean complete(int bookieIndex, BookieId host, ByteBufList bufList)
- Overrides:
complete
in classBatchedReadOp.BatchedLedgerEntryRequest
-
-