Package org.apache.bookkeeper.client
Class ReadLastConfirmedAndEntryOp
- java.lang.Object
-
- org.apache.bookkeeper.client.ReadLastConfirmedAndEntryOp
-
- All Implemented Interfaces:
SpeculativeRequestExecutor
,BookkeeperInternalCallbacks.ReadEntryCallback
class ReadLastConfirmedAndEntryOp extends java.lang.Object implements BookkeeperInternalCallbacks.ReadEntryCallback, SpeculativeRequestExecutor
Long poll read operation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interface
ReadLastConfirmedAndEntryOp.LastConfirmedAndEntryCallback
Wrapper to get all recovered data from the request.(package private) class
ReadLastConfirmedAndEntryOp.ParallelReadRequest
(package private) class
ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
(package private) class
ReadLastConfirmedAndEntryOp.SequenceReadRequest
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.BitSet
emptyResponsesFromHostsBitSet
(package private) java.util.BitSet
heardFromHostsBitSet
(package private) static org.slf4j.Logger
LOG
(package private) int
maxMissedReadsAllowed
(package private) boolean
parallelRead
(package private) ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest
request
(package private) java.util.concurrent.atomic.AtomicBoolean
requestComplete
(package private) long
requestTimeNano
-
Constructor Summary
Constructors Constructor Description ReadLastConfirmedAndEntryOp(LedgerHandle lh, ClientContext clientCtx, java.util.List<BookieId> ensemble, ReadLastConfirmedAndEntryOp.LastConfirmedAndEntryCallback cb, long prevEntryId, long timeOutInMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cancelSpeculativeTask(boolean mayInterruptIfRunning)
protected LedgerMetadata
getLedgerMetadata()
void
initiate()
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean>
issueSpeculativeRequest()
Speculative Read Logic.(package private) ReadLastConfirmedAndEntryOp
parallelRead(boolean enabled)
void
readEntryComplete(int rc, long ledgerId, long entryId, io.netty.buffer.ByteBuf buffer, java.lang.Object ctx)
(package private) void
sendReadTo(int bookieIndex, BookieId to, ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest entry)
java.lang.String
toString()
-
-
-
Field Detail
-
LOG
static final org.slf4j.Logger LOG
-
request
ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest request
-
heardFromHostsBitSet
final java.util.BitSet heardFromHostsBitSet
-
emptyResponsesFromHostsBitSet
final java.util.BitSet emptyResponsesFromHostsBitSet
-
maxMissedReadsAllowed
final int maxMissedReadsAllowed
-
parallelRead
boolean parallelRead
-
requestComplete
final java.util.concurrent.atomic.AtomicBoolean requestComplete
-
requestTimeNano
final long requestTimeNano
-
-
Constructor Detail
-
ReadLastConfirmedAndEntryOp
ReadLastConfirmedAndEntryOp(LedgerHandle lh, ClientContext clientCtx, java.util.List<BookieId> ensemble, ReadLastConfirmedAndEntryOp.LastConfirmedAndEntryCallback cb, long prevEntryId, long timeOutInMillis)
-
-
Method Detail
-
getLedgerMetadata
protected LedgerMetadata getLedgerMetadata()
-
parallelRead
ReadLastConfirmedAndEntryOp parallelRead(boolean enabled)
-
cancelSpeculativeTask
protected void cancelSpeculativeTask(boolean mayInterruptIfRunning)
-
issueSpeculativeRequest
public com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> issueSpeculativeRequest()
Speculative Read Logic.- Specified by:
issueSpeculativeRequest
in interfaceSpeculativeRequestExecutor
- Returns:
- whether more speculative requests should be issued
-
initiate
public void initiate()
-
sendReadTo
void sendReadTo(int bookieIndex, BookieId to, ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest entry) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
readEntryComplete
public void readEntryComplete(int rc, long ledgerId, long entryId, io.netty.buffer.ByteBuf buffer, java.lang.Object ctx)
- Specified by:
readEntryComplete
in interfaceBookkeeperInternalCallbacks.ReadEntryCallback
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-