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:
java.lang.AutoCloseable
- Enclosing class:
- ReadLastConfirmedAndEntryOp
class ReadLastConfirmedAndEntryOp.SequenceReadRequest extends ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.BitSet
emptyResponseReplicas
(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.ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
complete, ensemble, entryImpl, firstError, numMissedEntryReads, orderedEnsemble, rc, writeSet
-
-
Constructor Summary
Constructors Constructor Description SequenceReadRequest(java.util.List<BookieId> ensemble, long lId, long eId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
complete(int bookieIndex, BookieId host, io.netty.buffer.ByteBuf buffer, long entryId)
Complete the read request from host.(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.ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
close, fail, getFirstError, getRc, isComplete, toString
-
-
-
-
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
-
emptyResponseReplicas
final java.util.BitSet emptyResponseReplicas
-
-
Constructor Detail
-
SequenceReadRequest
SequenceReadRequest(java.util.List<BookieId> ensemble, long lId, long eId)
-
-
Method Detail
-
maybeSendSpeculativeRead
BookieId maybeSendSpeculativeRead(java.util.BitSet heardFrom)
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 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.ReadLACAndEntryRequest
Execute the read request.- Specified by:
read
in classReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
-
sendNextRead
BookieId sendNextRead()
-
logErrorAndReattemptRead
void logErrorAndReattemptRead(int bookieIndex, BookieId host, java.lang.String errMsg, int rc)
Description copied from class:ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
Log error errMsg and reattempt read from host.- Overrides:
logErrorAndReattemptRead
in classReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
- Parameters:
bookieIndex
- bookie indexhost
- host that just responderrMsg
- error msg to logrc
- read result code
-
complete
boolean complete(int bookieIndex, BookieId host, io.netty.buffer.ByteBuf buffer, long entryId)
Description copied from class:ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
Complete the read request from host.- Overrides:
complete
in 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
-
-