org.apache.cassandra.service
Class DatacenterReadCallback<T>
java.lang.Object
org.apache.cassandra.service.ReadCallback<T>
org.apache.cassandra.service.DatacenterReadCallback<T>
- All Implemented Interfaces:
- IAsyncCallback, IMessageCallback
public class DatacenterReadCallback<T>
- extends ReadCallback<T>
Datacenter Quorum response handler blocks for a quorum of responses from the local DC
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatacenterReadCallback
public DatacenterReadCallback(IResponseResolver resolver,
org.apache.cassandra.thrift.ConsistencyLevel consistencyLevel,
IReadCommand command,
java.util.List<java.net.InetAddress> endpoints)
sortForConsistencyLevel
protected void sortForConsistencyLevel(java.util.List<java.net.InetAddress> endpoints)
- Description copied from class:
ReadCallback
- Endpoints is already restricted to live replicas, sorted by snitch preference. This is a hook for
DatacenterReadCallback to move local-DC replicas to the front of the list. We need this both
when doing read repair (because the first replica gets the data read) and otherwise (because
only the first 1..blockfor replicas will get digest reads).
- Overrides:
sortForConsistencyLevel
in class ReadCallback<T>
waitingFor
protected boolean waitingFor(Message message)
- Overrides:
waitingFor
in class ReadCallback<T>
- Returns:
- true if the message counts towards the blockfor threshold
TODO turn the Message into a response so we don't need two versions of this method
waitingFor
protected boolean waitingFor(ReadResponse response)
- Overrides:
waitingFor
in class ReadCallback<T>
- Returns:
- true if the response counts towards the blockfor threshold
determineBlockFor
public int determineBlockFor(org.apache.cassandra.thrift.ConsistencyLevel consistency_level,
java.lang.String table)
- Overrides:
determineBlockFor
in class ReadCallback<T>
assureSufficientLiveNodes
public void assureSufficientLiveNodes()
throws org.apache.cassandra.thrift.UnavailableException
- Overrides:
assureSufficientLiveNodes
in class ReadCallback<T>
- Throws:
org.apache.cassandra.thrift.UnavailableException
Copyright © 2012 The Apache Software Foundation