org.apache.cassandra.service
Class QuorumResponseHandler<T>

java.lang.Object
  extended by org.apache.cassandra.service.QuorumResponseHandler<T>
All Implemented Interfaces:
IAsyncCallback, IMessageCallback
Direct Known Subclasses:
DatacenterQuorumResponseHandler

public class QuorumResponseHandler<T>
extends java.lang.Object
implements IAsyncCallback


Field Summary
protected  int blockfor
           
protected  SimpleCondition condition
           
protected static org.slf4j.Logger logger
           
protected  IResponseResolver<T> resolver
           
 
Constructor Summary
QuorumResponseHandler(IResponseResolver<T> resolver, ConsistencyLevel consistencyLevel, java.lang.String table)
          Constructor when response count has to be calculated and blocked for.
 
Method Summary
 void assureSufficientLiveNodes(java.util.Collection<java.net.InetAddress> endpoints)
           
 int determineBlockFor(ConsistencyLevel consistencyLevel, java.lang.String table)
           
 T get()
           
 void response(Message message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger

condition

protected final SimpleCondition condition

resolver

protected final IResponseResolver<T> resolver

blockfor

protected final int blockfor
Constructor Detail

QuorumResponseHandler

public QuorumResponseHandler(IResponseResolver<T> resolver,
                             ConsistencyLevel consistencyLevel,
                             java.lang.String table)
Constructor when response count has to be calculated and blocked for.

Method Detail

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.

determineBlockFor

public int determineBlockFor(ConsistencyLevel consistencyLevel,
                             java.lang.String table)

assureSufficientLiveNodes

public void assureSufficientLiveNodes(java.util.Collection<java.net.InetAddress> endpoints)
                               throws UnavailableException
Throws:
UnavailableException


Copyright © 2011 The Apache Software Foundation