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.Logger
logger
ResponseResolver<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 boolean
await(long timePastStart, java.util.concurrent.TimeUnit unit)
void
awaitResults()
int
blockFor()
boolean
invokeOnFailure()
void
onFailure(InetAddressAndPort from, RequestFailureReason failureReason)
Called when there is an exception on the remote node or timeout happensvoid
onResponse(Message<ReadResponse> message)
protected P
replicaPlan()
void
response(ReadResponse result)
boolean
trackLatencyForSnitch()
-
-
-
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:
onResponse
in interfaceRequestCallback<E extends Endpoints<E>>
- Parameters:
message
- response received.
-
response
public void response(ReadResponse result)
-
trackLatencyForSnitch
public boolean trackLatencyForSnitch()
- Specified by:
trackLatencyForSnitch
in 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:RequestCallback
Called when there is an exception on the remote node or timeout happens- Specified by:
onFailure
in interfaceRequestCallback<E extends Endpoints<E>>
-
invokeOnFailure
public boolean invokeOnFailure()
- Specified by:
invokeOnFailure
in interfaceRequestCallback<E extends Endpoints<E>>
- Returns:
- true if the callback should be invoked on failure
-
-