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.
|
<T> IgniteFuture<T> |
chainAsync(IgniteClosure<? super IgniteFuture<V>,T> doneCb,
Executor exec)
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,
@Nullable Executor exec) |
protected RuntimeException |
convertException(IgniteCheckedException e)
Convert internal exception to public exception.
|
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.
|
void |
listenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr,
Executor exec)
Registers listener closure to be asynchronously notified whenever future completes.
|
String |
toString() |
protected final IgniteInternalFuture<V> fut
public IgniteFutureImpl(IgniteInternalFuture<V> fut)
fut - Future.public IgniteInternalFuture<V> internalFuture()
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. Cannot be null.public void listenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr, Executor exec)
listenAsync in interface IgniteFuture<V>lsnr - Listener closure to register. Cannot be null.exec - Executor to run listener. Cannot be null.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.public <T> IgniteFuture<T> chainAsync(IgniteClosure<? super IgniteFuture<V>,T> doneCb, Executor exec)
chainAsync in interface IgniteFuture<V>doneCb - Done callback that is applied to this future when it finishes to produce chained future result.exec - Executor to run done callback. Cannot be null.protected <T> IgniteInternalFuture<T> chainInternal(IgniteClosure<? super IgniteFuture<V>,T> doneCb, @Nullable @Nullable Executor exec)
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 Database and Caching Platform : ver. 2.8.1 Release Date : May 21 2020