Class ReadCallback<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E>>
- java.lang.Object
-
- org.apache.cassandra.service.reads.ReadCallback<E,P>
-
- All Implemented Interfaces:
RequestCallback<ReadResponse>
public class ReadCallback<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E>> extends java.lang.Object implements RequestCallback<ReadResponse>
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerloggerResponseResolver<E,P>resolver
-
Constructor Summary
Constructors Constructor Description ReadCallback(ResponseResolver<E,P> resolver, ReadCommand command, ReplicaPlan.Shared<E,P> replicaPlan, long queryStartNanoTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawait(long timePastStart, java.util.concurrent.TimeUnit unit)voidawaitResults()intblockFor()booleaninvokeOnFailure()voidonFailure(InetAddressAndPort from, RequestFailureReason failureReason)Called when there is an exception on the remote node or timeout happensvoidonResponse(Message<ReadResponse> message)protected PreplicaPlan()voidresponse(ReadResponse result)booleantrackLatencyForSnitch()
-
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
resolver
public final ResponseResolver<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E>> resolver
-
-
Constructor Detail
-
ReadCallback
public ReadCallback(ResponseResolver<E,P> resolver, ReadCommand command, ReplicaPlan.Shared<E,P> replicaPlan, long queryStartNanoTime)
-
-
Method Detail
-
replicaPlan
protected P replicaPlan()
-
await
public boolean await(long timePastStart, java.util.concurrent.TimeUnit unit)
-
awaitResults
public void awaitResults() throws ReadFailureException, ReadTimeoutException
-
blockFor
public int blockFor()
-
onResponse
public void onResponse(Message<ReadResponse> message)
- Specified by:
onResponsein interfaceRequestCallback<E extends Endpoints<E>>- Parameters:
message- response received.
-
response
public void response(ReadResponse result)
-
trackLatencyForSnitch
public boolean trackLatencyForSnitch()
- Specified by:
trackLatencyForSnitchin interfaceRequestCallback<E extends Endpoints<E>>- Returns:
- true if this callback is on the read path and its latency should be given as input to the dynamic snitch.
-
onFailure
public void onFailure(InetAddressAndPort from, RequestFailureReason failureReason)
Description copied from interface:RequestCallbackCalled when there is an exception on the remote node or timeout happens- Specified by:
onFailurein interfaceRequestCallback<E extends Endpoints<E>>
-
invokeOnFailure
public boolean invokeOnFailure()
- Specified by:
invokeOnFailurein interfaceRequestCallback<E extends Endpoints<E>>- Returns:
- true if the callback should be invoked on failure
-
-