T - The core response type.S - The core query info type.T2 - The converted response type.S2 - The converted query info type.public abstract class ImmediateCoreFutureAdapter<T2,S2,T,S> extends CoreFutureAdapter<T2,S2,T,S>
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmediateCoreFutureAdapter.SameQueryInfo<T2,S,T> |
| Modifier | Constructor and Description |
|---|---|
protected |
ImmediateCoreFutureAdapter(RiakFuture<T,S> coreFuture,
T2 immediateResponse) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract S2 |
convertQueryInfo(S coreQueryInfo) |
protected T2 |
convertResponse(T unused) |
T2 |
get()
Waits for this RiakFuture to be completed if necessary and returns the response if available.
|
T2 |
get(long timeout,
TimeUnit unit)
Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result, if available.
|
T2 |
getNow()
Return the result without blocking or throwing an exception.
|
await, await, cancel, cause, getQueryInfo, handle, isCancelled, isDone, isSuccessaddListener, notifyListeners, removeListenerprotected ImmediateCoreFutureAdapter(RiakFuture<T,S> coreFuture, T2 immediateResponse)
public T2 get() throws InterruptedException, ExecutionException
RiakFutureget in interface RiakFuture<T2,S2>get in interface Future<T2>get in class CoreFutureAdapter<T2,S2,T,S>InterruptedException - if the current thread was interrupted
while waitingExecutionException - if the computation threw an
exceptionpublic T2 get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
RiakFutureNote that the timeout value here is how long you are willing to wait for this RiakFuture to complete. If you wish to set a timeout on the command itself, use the timeout() method provided in the command's associated builder.
get in interface RiakFuture<T2,S2>get in interface Future<T2>get in class CoreFutureAdapter<T2,S2,T,S>timeout - the amount of time to wait before returning.unit - the unit of time.InterruptedException - if the current thread was interrupted
while waiting.ExecutionException - if the computation threw an
exception.TimeoutException - if the wait timed out.public T2 getNow()
RiakFutureRiakFuture.isDone()
and not rely on the returned null value.getNow in interface RiakFuture<T2,S2>getNow in class CoreFutureAdapter<T2,S2,T,S>RiakFuture.isDone(),
RiakFuture.isSuccess()protected T2 convertResponse(T unused)
convertResponse in class CoreFutureAdapter<T2,S2,T,S>protected abstract S2 convertQueryInfo(S coreQueryInfo)
convertQueryInfo in class CoreFutureAdapter<T2,S2,T,S>Copyright © 2016. All rights reserved.