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

java.lang.Object
  extended by 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


Field Summary
protected  int blockfor
           
protected  SimpleCondition condition
           
protected static org.slf4j.Logger logger
           
 IResponseResolver<T> resolver
           
 
Constructor Summary
ReadCallback(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)
           
 void response(ReadResponse result)
           
 
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

resolver

public final IResponseResolver<T> resolver

condition

protected final SimpleCondition condition

blockfor

protected final int blockfor
Constructor Detail

ReadCallback

public ReadCallback(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.

response

public void response(ReadResponse result)

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