Package org.apache.bookkeeper.client
Class ReadLastConfirmedAndEntryOp.SequenceReadRequest
java.lang.Object
org.apache.bookkeeper.client.ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
org.apache.bookkeeper.client.ReadLastConfirmedAndEntryOp.SequenceReadRequest
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- ReadLastConfirmedAndEntryOp
class ReadLastConfirmedAndEntryOp.SequenceReadRequest
extends ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BitSet(package private) final BitSet(package private) int(package private) static final int(package private) final BitSetFields inherited from class org.apache.bookkeeper.client.ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
complete, ensemble, entryImpl, firstError, numMissedEntryReads, orderedEnsemble, rc, writeSet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleanComplete the read request from host.(package private) voidlogErrorAndReattemptRead(int bookieIndex, BookieId host, String errMsg, int rc) Log error errMsg and reattempt read from host.(package private) BookieIdmaybeSendSpeculativeRead(BitSet heardFrom) Send to next replica speculatively, if required and possible.(package private) voidread()Execute the read request.(package private) BookieIdMethods inherited from class org.apache.bookkeeper.client.ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
close, fail, getFirstError, getRc, isComplete, toString
-
Field Details
-
NOT_FOUND
static final int NOT_FOUND- See Also:
-
nextReplicaIndexToReadFrom
int nextReplicaIndexToReadFrom -
sentReplicas
-
erroredReplicas
-
emptyResponseReplicas
-
-
Constructor Details
-
SequenceReadRequest
-
-
Method Details
-
maybeSendSpeculativeRead
Send to next replica speculatively, if required and possible. This returns the host we may have sent to for unit testing.- Specified by:
maybeSendSpeculativeReadin classReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest- Parameters:
heardFrom- the set of hosts that we already received responses.- Returns:
- host we sent to if we sent. null otherwise.
-
read
void read()Description copied from class:ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequestExecute the read request.- Specified by:
readin classReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
-
sendNextRead
BookieId sendNextRead() -
logErrorAndReattemptRead
Description copied from class:ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequestLog error errMsg and reattempt read from host.- Overrides:
logErrorAndReattemptReadin classReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest- Parameters:
bookieIndex- bookie indexhost- host that just responderrMsg- error msg to logrc- read result code
-
complete
Description copied from class:ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequestComplete the read request from host.- Overrides:
completein classReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest- Parameters:
bookieIndex- bookie indexhost- host that respond the readbuffer- the data buffer- Returns:
- return true if we managed to complete the entry; otherwise return false if the read entry is not complete or it is already completed before
-