net.spy.memcached.internal
Class BulkGetFuture<T>

java.lang.Object
  extended by net.spy.memcached.internal.BulkGetFuture<T>
Type Parameters:
T - types of objects returned from the GET
All Implemented Interfaces:
Future<Map<String,T>>, BulkFuture<Map<String,T>>

public class BulkGetFuture<T>
extends Object
implements BulkFuture<Map<String,T>>

Future for handling results from bulk gets. Not intended for general use.


Constructor Summary
BulkGetFuture(Map<String,Future<T>> m, Collection<Operation> getOps, CountDownLatch l)
           
 
Method Summary
 boolean cancel(boolean ign)
           
 Map<String,T> get()
           
 Map<String,T> get(long to, TimeUnit unit)
           
 Map<String,T> getSome(long to, TimeUnit unit)
          Wait for the operation to complete and return results If operation could not complete within specified timeout, partial result is returned.
 boolean isCancelled()
           
 boolean isDone()
           
 boolean isTimeout()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BulkGetFuture

public BulkGetFuture(Map<String,Future<T>> m,
                     Collection<Operation> getOps,
                     CountDownLatch l)
Method Detail

cancel

public boolean cancel(boolean ign)
Specified by:
cancel in interface Future<Map<String,T>>

get

public Map<String,T> get()
                  throws InterruptedException,
                         ExecutionException
Specified by:
get in interface Future<Map<String,T>>
Throws:
InterruptedException
ExecutionException

getSome

public Map<String,T> getSome(long to,
                             TimeUnit unit)
                      throws InterruptedException,
                             ExecutionException
Description copied from interface: BulkFuture
Wait for the operation to complete and return results If operation could not complete within specified timeout, partial result is returned. Otherwise, the behavior is identical to Future.get(long, TimeUnit)

Specified by:
getSome in interface BulkFuture<Map<String,T>>
Returns:
Throws:
InterruptedException
ExecutionException

get

public Map<String,T> get(long to,
                         TimeUnit unit)
                  throws InterruptedException,
                         ExecutionException,
                         TimeoutException
Specified by:
get in interface Future<Map<String,T>>
Throws:
InterruptedException
ExecutionException
TimeoutException

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface Future<Map<String,T>>

isDone

public boolean isDone()
Specified by:
isDone in interface Future<Map<String,T>>

isTimeout

public boolean isTimeout()
Specified by:
isTimeout in interface BulkFuture<Map<String,T>>
Returns:
true if timeout was reached, false otherwise