public class ReadCallback<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E>> extends java.lang.Object implements RequestCallback<ReadResponse>
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
ResponseResolver |
resolver |
| Constructor and Description |
|---|
ReadCallback(ResponseResolver resolver,
ReadCommand command,
ReplicaPlan.Shared<E,P> replicaPlan,
long queryStartNanoTime) |
| Modifier and Type | Method and 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 happens
|
void |
onResponse(Message<ReadResponse> message) |
protected P |
replicaPlan() |
void |
response(ReadResponse result) |
boolean |
trackLatencyForSnitch() |
protected static final org.slf4j.Logger logger
public final ResponseResolver resolver
public ReadCallback(ResponseResolver resolver, ReadCommand command, ReplicaPlan.Shared<E,P> replicaPlan, long queryStartNanoTime)
protected P replicaPlan()
public boolean await(long timePastStart,
java.util.concurrent.TimeUnit unit)
public void awaitResults()
throws ReadFailureException,
ReadTimeoutException
public int blockFor()
public void onResponse(Message<ReadResponse> message)
onResponse in interface RequestCallback<ReadResponse>message - response received.public void response(ReadResponse result)
public boolean trackLatencyForSnitch()
trackLatencyForSnitch in interface RequestCallback<ReadResponse>public void onFailure(InetAddressAndPort from, RequestFailureReason failureReason)
RequestCallbackonFailure in interface RequestCallback<ReadResponse>public boolean invokeOnFailure()
invokeOnFailure in interface RequestCallback<ReadResponse>Copyright © 2009-2020 The Apache Software Foundation