public class IgniteFutureImpl<V> extends Object implements IgniteFuture<V>
| Modifier and Type | Field and Description |
|---|---|
protected IgniteInternalFuture<V> |
fut |
| Constructor and Description |
|---|
IgniteFutureImpl(IgniteInternalFuture<V> fut) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
Cancels this future.
|
<T> IgniteFuture<T> |
chain(IgniteClosure<? super IgniteFuture<V>,T> doneCb)
Make a chained future to convert result of this future (when complete) into a new format.
|
protected <T> IgniteInternalFuture<T> |
chainInternal(IgniteClosure<? super IgniteFuture<V>,T> doneCb) |
protected RuntimeException |
convertException(IgniteCheckedException e)
Convert internal exception to public exception.
|
long |
duration()
Gets duration in milliseconds between start of the future and current time if future
is not finished, or between start and finish of this future.
|
V |
get()
Synchronously waits for completion of the computation and
returns computation result.
|
V |
get(long timeout)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
V |
get(long timeout,
TimeUnit unit)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
IgniteInternalFuture<V> |
internalFuture() |
boolean |
isCancelled()
Returns
true if this task was cancelled before it completed
normally. |
boolean |
isDone()
Returns
true if this task completed. |
void |
listen(IgniteInClosure<? super IgniteFuture<V>> lsnr)
Registers listener closure to be asynchronously notified whenever future completes.
|
long |
startTime()
Gets start time for this future.
|
String |
toString() |
protected final IgniteInternalFuture<V> fut
public IgniteFutureImpl(IgniteInternalFuture<V> fut)
fut - Future.public IgniteInternalFuture<V> internalFuture()
public long startTime()
startTime in interface IgniteFuture<V>public long duration()
duration in interface IgniteFuture<V>public boolean isCancelled()
true if this task was cancelled before it completed
normally.isCancelled in interface IgniteFuture<V>true if this task was cancelled before it completedpublic boolean isDone()
true if this task completed.
Completion may be due to normal termination, an exception, or
cancellation - in all of these cases, this method will return
true.
isDone in interface IgniteFuture<V>true if this task completed.public void listen(IgniteInClosure<? super IgniteFuture<V>> lsnr)
listen in interface IgniteFuture<V>lsnr - Listener closure to register. If not provided - this method is no-op.public <T> IgniteFuture<T> chain(IgniteClosure<? super IgniteFuture<V>,T> doneCb)
chain in interface IgniteFuture<V>doneCb - Done callback that is applied to this future when it finishes to produce chained future result.protected <T> IgniteInternalFuture<T> chainInternal(IgniteClosure<? super IgniteFuture<V>,T> doneCb)
doneCb - Done callback.public boolean cancel()
throws IgniteException
cancel in interface IgniteFuture<V>True if future was canceled (i.e. was not finished prior to this call).IgniteException - If cancellation failed.public V get()
get in interface IgniteFuture<V>public V get(long timeout)
get(long, TimeUnit.MILLISECONDS).get in interface IgniteFuture<V>timeout - The maximum time to wait in milliseconds.public V get(long timeout, TimeUnit unit)
get in interface IgniteFuture<V>timeout - The maximum time to wait.unit - The time unit of the timeout argument.protected RuntimeException convertException(IgniteCheckedException e)
e - Internal exception.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.4.0 Release Date : September 24 2015