org.apache.cassandra.net
Interface IAsyncResult

All Known Implementing Classes:
MultiAsyncResult

public interface IAsyncResult

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


Method Summary
 byte[] get()
          Returns the result for the task that was submitted.
 byte[] get(long timeout, java.util.concurrent.TimeUnit tu)
          Same operation as the above get() but allows the calling thread to specify a timeout.
 boolean isDone()
          This is used to check if the task has been completed
 java.util.List<byte[]> multiget()
          Returns the result for all tasks that was submitted.
 java.util.List<byte[]> multiget(long timeout, java.util.concurrent.TimeUnit tu)
          Same operation as the above get() but allows the calling thread to specify a timeout.
 void result(Message result)
          Store the result obtained for the submitted task.
 

Method Detail

isDone

boolean isDone()
This is used to check if the task has been completed

Returns:
true if the task has been completed and false otherwise.

get

byte[] get()
Returns the result for the task that was submitted.

Returns:
the result wrapped in an Object[]

get

byte[] get(long timeout,
           java.util.concurrent.TimeUnit tu)
           throws java.util.concurrent.TimeoutException
Same operation as the above get() but allows the calling thread to specify a timeout.

Parameters:
timeout - the maximum time to wait
tu - the time unit of the timeout argument
Returns:
the result wrapped in an Object[]
Throws:
java.util.concurrent.TimeoutException

multiget

java.util.List<byte[]> multiget()
Returns the result for all tasks that was submitted.

Returns:
the list of results wrapped in an Object[]

multiget

java.util.List<byte[]> multiget(long timeout,
                                java.util.concurrent.TimeUnit tu)
                                throws java.util.concurrent.TimeoutException
Same operation as the above get() but allows the calling thread to specify a timeout.

Parameters:
timeout - the maximum time to wait
tu - the time unit of the timeout argument
Returns:
the result wrapped in an Object[]
Throws:
java.util.concurrent.TimeoutException

result

void result(Message result)
Store the result obtained for the submitted task.

Parameters:
result - the response message


Copyright © 2009 The Apache Software Foundation