org.apache.cassandra.service
Class MultiQuorumResponseHandler

java.lang.Object
  extended by org.apache.cassandra.service.MultiQuorumResponseHandler
All Implemented Interfaces:
IAsyncCallback

public class MultiQuorumResponseHandler
extends java.lang.Object
implements IAsyncCallback

Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )


Constructor Summary
MultiQuorumResponseHandler(java.util.Map<java.lang.String,ReadCommand> readMessages, java.util.Map<java.lang.String,EndPoint[]> endpoints)
           
 
Method Summary
 void attachContext(java.lang.Object o)
          The context that is passed in for the query of multiple keys in the system.
 Row[] get()
           
 void response(Message message)
          The handler of the response message that has been sent by one of the replicas for one of the keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiQuorumResponseHandler

public MultiQuorumResponseHandler(java.util.Map<java.lang.String,ReadCommand> readMessages,
                                  java.util.Map<java.lang.String,EndPoint[]> endpoints)
Method Detail

get

public Row[] get()
          throws java.util.concurrent.TimeoutException
Throws:
java.util.concurrent.TimeoutException

response

public void response(Message message)
The handler of the response message that has been sent by one of the replicas for one of the keys.

Specified by:
response in interface IAsyncCallback
Parameters:
message - the reponse message for one of the message that we sent out.

attachContext

public void attachContext(java.lang.Object o)
The context that is passed in for the query of multiple keys in the system. For each message id in the context register a callback handler for the same. This is done so that all responses for a given key use the same callback handler.

Specified by:
attachContext in interface IAsyncCallback
Parameters:
o - the context which is an array of strings corresponding to the message id's for each key.


Copyright © 2009 The Apache Software Foundation