net.spy.memcached.internal
Class BulkGetFuture<T>
java.lang.Object
net.spy.memcached.internal.BulkGetFuture<T>
- Type Parameters:
T
- types of objects returned from the GET
- All Implemented Interfaces:
- java.util.concurrent.Future<java.util.Map<java.lang.String,T>>, BulkFuture<java.util.Map<java.lang.String,T>>
public class BulkGetFuture<T>
- extends java.lang.Object
- implements BulkFuture<java.util.Map<java.lang.String,T>>
Future for handling results from bulk gets.
Not intended for general use.
Constructor Summary |
BulkGetFuture(java.util.Map<java.lang.String,java.util.concurrent.Future<T>> m,
java.util.Collection<Operation> getOps,
java.util.concurrent.CountDownLatch l)
|
Method Summary |
boolean |
cancel(boolean ign)
|
java.util.Map<java.lang.String,T> |
get()
|
java.util.Map<java.lang.String,T> |
get(long to,
java.util.concurrent.TimeUnit unit)
|
java.util.Map<java.lang.String,T> |
getSome(long to,
java.util.concurrent.TimeUnit unit)
Wait for the operation to complete and return results
If operation could not complete within specified timeout, partial result is
returned. |
OperationStatus |
getStatus()
Gets the status of the operation upon completion. |
boolean |
isCancelled()
|
boolean |
isDone()
|
boolean |
isTimeout()
|
void |
setStatus(OperationStatus s)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BulkGetFuture
public BulkGetFuture(java.util.Map<java.lang.String,java.util.concurrent.Future<T>> m,
java.util.Collection<Operation> getOps,
java.util.concurrent.CountDownLatch l)
cancel
public boolean cancel(boolean ign)
- Specified by:
cancel
in interface java.util.concurrent.Future<java.util.Map<java.lang.String,T>>
get
public java.util.Map<java.lang.String,T> get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
- Specified by:
get
in interface java.util.concurrent.Future<java.util.Map<java.lang.String,T>>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
getSome
public java.util.Map<java.lang.String,T> getSome(long to,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.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<java.util.Map<java.lang.String,T>>
- Returns:
- a partial get bulk result
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
get
public java.util.Map<java.lang.String,T> get(long to,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
- Specified by:
get
in interface java.util.concurrent.Future<java.util.Map<java.lang.String,T>>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
getStatus
public OperationStatus getStatus()
- Description copied from interface:
BulkFuture
- Gets the status of the operation upon completion.
- Specified by:
getStatus
in interface BulkFuture<java.util.Map<java.lang.String,T>>
- Returns:
- the operation status.
setStatus
public void setStatus(OperationStatus s)
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface java.util.concurrent.Future<java.util.Map<java.lang.String,T>>
isDone
public boolean isDone()
- Specified by:
isDone
in interface java.util.concurrent.Future<java.util.Map<java.lang.String,T>>
isTimeout
public boolean isTimeout()
- Specified by:
isTimeout
in interface BulkFuture<java.util.Map<java.lang.String,T>>
- Returns:
- true if timeout was reached, false otherwise
Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.