org.apache.cassandra.service
Class ReadCallback<T>
java.lang.Object
org.apache.cassandra.service.ReadCallback<T>
- All Implemented Interfaces:
- IAsyncCallback, IMessageCallback
- Direct Known Subclasses:
- DatacenterReadCallback
public class ReadCallback<T>
- extends java.lang.Object
- implements IAsyncCallback
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static final org.slf4j.Logger logger
resolver
public final IResponseResolver<T> resolver
condition
protected final SimpleCondition condition
blockfor
protected final int blockfor
ReadCallback
public ReadCallback(IResponseResolver<T> resolver,
ConsistencyLevel consistencyLevel,
IReadCommand command,
java.util.List<java.net.InetAddress> endpoints)
- Constructor when response count has to be calculated and blocked for.
get
public T get()
throws java.util.concurrent.TimeoutException,
DigestMismatchException,
java.io.IOException
- Throws:
java.util.concurrent.TimeoutException
DigestMismatchException
java.io.IOException
response
public void response(Message message)
- Specified by:
response
in interface IAsyncCallback
- Parameters:
message
- response received.
response
public void response(ReadResponse result)
maybeResolveForRepair
protected void maybeResolveForRepair()
- Check digests in the background on the Repair stage if we've received replies
too all the requests we sent.
determineBlockFor
public int determineBlockFor(ConsistencyLevel consistencyLevel,
java.lang.String table)
assureSufficientLiveNodes
public void assureSufficientLiveNodes()
throws UnavailableException
- Throws:
UnavailableException
isLatencyForSnitch
public boolean isLatencyForSnitch()
- Specified by:
isLatencyForSnitch
in interface IMessageCallback
- Returns:
- true if this callback is on the read path and its latency should be
given as input to the dynamic snitch.
Copyright © 2011 The Apache Software Foundation