Class AbstractReadExecutor
java.lang.Object
org.apache.cassandra.service.reads.AbstractReadExecutor
- Direct Known Subclasses:
AbstractReadExecutor.NeverSpeculatingReadExecutor
Sends a read request to the replicas needed to satisfy a given ConsistencyLevel.
Optionally, may perform additional requests to provide redundancy against replica failure:
AlwaysSpeculatingReadExecutor will always send a request to one extra replica, while
SpeculatingReadExecutor will wait until it looks like the original request is in danger
of timing out before performing extra reads.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ColumnFamilyStoreprotected final ReadCommandprotected final DigestResolver<EndpointsForToken,ReplicaPlan.ForTokenRead> protected final ReadCallback<EndpointsForToken,ReplicaPlan.ForTokenRead> protected final ReadRepair<EndpointsForToken,ReplicaPlan.ForTokenRead> protected final Dispatcher.RequestTimeprotected PartitionIteratorprotected final TraceState -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidawaitResponses(boolean logBlockingReadRepairAttempt) Wait for the CL to be satisfied by responsesvoidsend the initial set of requestsgetKey()static AbstractReadExecutorgetReadExecutor(SinglePartitionReadCommand command, ConsistencyLevel consistencyLevel, Dispatcher.RequestTime requestTime) booleanprotected voidmakeDigestRequests(Iterable<Replica> replicas) protected voidmakeFullDataRequests(ReplicaCollection<?> replicas) protected voidmakeTransientDataRequests(Iterable<Replica> replicas) voidabstract voidPerform additional requests if it looks like the original will time out.voidsetResult(PartitionIterator result)
-
Field Details
-
command
-
readRepair
-
digestResolver
-
handler
-
traceState
-
cfs
-
requestTime
-
result
-
-
Method Details
-
getKey
-
getReadRepair
-
makeFullDataRequests
-
makeTransientDataRequests
-
makeDigestRequests
-
maybeTryAdditionalReplicas
public abstract void maybeTryAdditionalReplicas()Perform additional requests if it looks like the original will time out. May block while it waits to see if the original requests are answered first. -
executeAsync
public void executeAsync()send the initial set of requests -
getReadExecutor
public static AbstractReadExecutor getReadExecutor(SinglePartitionReadCommand command, ConsistencyLevel consistencyLevel, Dispatcher.RequestTime requestTime) throws UnavailableException - Returns:
- an executor appropriate for the configured speculative read policy
- Throws:
UnavailableException
-
hasLocalRead
public boolean hasLocalRead() -
setResult
-
awaitResponses
- Throws:
ReadTimeoutException
-
awaitResponses
Wait for the CL to be satisfied by responses- Throws:
ReadTimeoutException
-
awaitReadRepair
- Throws:
ReadTimeoutException
-
maybeSendAdditionalDataRequests
public void maybeSendAdditionalDataRequests() -
getResult
-