org.apache.cassandra.service
Class AbstractWriteResponseHandler

java.lang.Object
  extended by org.apache.cassandra.service.AbstractWriteResponseHandler
All Implemented Interfaces:
IAsyncCallback, IMessageCallback, IWriteResponseHandler
Direct Known Subclasses:
DatacenterSyncWriteResponseHandler, WriteResponseHandler

public abstract class AbstractWriteResponseHandler
extends java.lang.Object
implements IWriteResponseHandler


Field Summary
protected  SimpleCondition condition
           
protected  org.apache.cassandra.thrift.ConsistencyLevel consistencyLevel
           
protected  java.util.List<CreationTimeAwareFuture<?>> hintFutures
           
protected  long startTime
           
protected  java.util.Collection<java.net.InetAddress> writeEndpoints
           
 
Constructor Summary
protected AbstractWriteResponseHandler(java.util.Collection<java.net.InetAddress> writeEndpoints, org.apache.cassandra.thrift.ConsistencyLevel consistencyLevel)
           
 
Method Summary
 void addFutureForHint(CreationTimeAwareFuture<?> hintFuture)
           
abstract  void assureSufficientLiveNodes()
           
 void get()
           
abstract  void response(Message msg)
          null message means "response from local write"
protected static void waitForHints(java.util.List<CreationTimeAwareFuture<?>> hintFutures)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cassandra.net.IMessageCallback
isLatencyForSnitch
 

Field Detail

condition

protected final SimpleCondition condition

startTime

protected final long startTime

writeEndpoints

protected final java.util.Collection<java.net.InetAddress> writeEndpoints

consistencyLevel

protected final org.apache.cassandra.thrift.ConsistencyLevel consistencyLevel

hintFutures

protected java.util.List<CreationTimeAwareFuture<?>> hintFutures
Constructor Detail

AbstractWriteResponseHandler

protected AbstractWriteResponseHandler(java.util.Collection<java.net.InetAddress> writeEndpoints,
                                       org.apache.cassandra.thrift.ConsistencyLevel consistencyLevel)
Method Detail

get

public void get()
         throws java.util.concurrent.TimeoutException
Specified by:
get in interface IWriteResponseHandler
Throws:
java.util.concurrent.TimeoutException

addFutureForHint

public void addFutureForHint(CreationTimeAwareFuture<?> hintFuture)
Specified by:
addFutureForHint in interface IWriteResponseHandler

waitForHints

protected static void waitForHints(java.util.List<CreationTimeAwareFuture<?>> hintFutures)
                            throws java.util.concurrent.TimeoutException
Throws:
java.util.concurrent.TimeoutException

response

public abstract void response(Message msg)
null message means "response from local write"

Specified by:
response in interface IAsyncCallback
Parameters:
msg - response received.

assureSufficientLiveNodes

public abstract void assureSufficientLiveNodes()
                                        throws org.apache.cassandra.thrift.UnavailableException
Specified by:
assureSufficientLiveNodes in interface IWriteResponseHandler
Throws:
org.apache.cassandra.thrift.UnavailableException


Copyright © 2011 The Apache Software Foundation