Package org.apache.bookkeeper.client
Class ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
java.lang.Object
org.apache.bookkeeper.client.ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
ReadLastConfirmedAndEntryOp.ParallelReadRequest,ReadLastConfirmedAndEntryOp.SequenceReadRequest
- Enclosing class:
- ReadLastConfirmedAndEntryOp
abstract class ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
extends Object
implements AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final AtomicBoolean(package private) final LedgerEntryImpl(package private) int(package private) int(package private) final DistributionSchedule.WriteSet(package private) int(package private) final DistributionSchedule.WriteSet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()(package private) booleanComplete the read request from host.(package private) booleanfail(int rc) Fail the request with given result code rc.(package private) int(package private) intgetRc()Get result code of this entry.(package private) booleanWhether the read request completed.(package private) voidlogErrorAndReattemptRead(int bookieIndex, BookieId host, String errMsg, int rc) Log error errMsg and reattempt read from host.(package private) abstract BookieIdmaybeSendSpeculativeRead(BitSet heardFromHostsBitSet) Send to next replica speculatively, if required and possible.(package private) abstract voidread()Execute the read request.toString()
-
Field Details
-
complete
-
rc
int rc -
firstError
int firstError -
numMissedEntryReads
int numMissedEntryReads -
ensemble
-
writeSet
-
orderedEnsemble
-
entryImpl
-
-
Constructor Details
-
ReadLACAndEntryRequest
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getFirstError
int getFirstError() -
read
abstract void read()Execute the read request. -
complete
Complete the read request from host.- 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
-
fail
boolean fail(int rc) Fail the request with given result code rc.- Parameters:
rc- result code to fail the request.- Returns:
- true if we managed to fail the entry; otherwise return false if it already failed or completed.
-
logErrorAndReattemptRead
Log error errMsg and reattempt read from host.- Parameters:
bookieIndex- bookie indexhost- host that just responderrMsg- error msg to logrc- read result code
-
maybeSendSpeculativeRead
Send to next replica speculatively, if required and possible. This returns the host we may have sent to for unit testing.- Parameters:
heardFromHostsBitSet- the set of hosts that we already received responses.- Returns:
- host we sent to if we sent. null otherwise.
-
isComplete
boolean isComplete()Whether the read request completed.- Returns:
- true if the read request is completed.
-
getRc
int getRc()Get result code of this entry.- Returns:
- result code.
-
toString
-