Class PlatformCompute.ComputeConvertingFuture
- java.lang.Object
-
- org.apache.ignite.internal.processors.platform.compute.PlatformCompute.ComputeConvertingFuture
-
- All Implemented Interfaces:
IgniteInternalFuture
- Enclosing class:
- PlatformCompute
protected class PlatformCompute.ComputeConvertingFuture extends Object implements IgniteInternalFuture
Wraps ComputeTaskFuture as IgniteInternalFuture.
-
-
Constructor Summary
Constructors Constructor Description ComputeConvertingFuture(ComputeTaskFuture fut)Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel()Cancels this future.IgniteInternalFuturechain(IgniteClosure doneCb)Make a chained future to convert result of this future (when complete) into a new format.IgniteInternalFuturechain(IgniteClosure doneCb, Executor exec)Make a chained future to convert result of this future (when complete) into a new format.IgniteInternalFuturechain(IgniteOutClosure doneCb)Make a chained future to convert result of this future (when complete) into a new format.IgniteInternalFuturechain(IgniteOutClosure doneCb, Executor exec)Make a chained future to convert result of this future (when complete) into a new format.IgniteInternalFuturechainCompose(IgniteClosure doneCb)Make a chained future that is completed whendoneCbis executed.IgniteInternalFuturechainCompose(IgniteClosure doneCb, @Nullable Executor exec)Make a chained future that is completed whendoneCbis executed.protected ObjectconvertResult(Object obj)Converts future result.Throwableerror()Objectget()Synchronously waits for completion of the computation and returns computation result.Objectget(long timeout)Synchronously waits for completion of the computation for up to the timeout specified and returns computation result.Objectget(long timeout, TimeUnit unit)Synchronously waits for completion of the computation for up to the timeout specified and returns computation result.ObjectgetUninterruptibly()Synchronously waits for completion of the computation and returns computation result ignoring interrupts.booleanisCancelled()Returnstrueif this computation was cancelled before it completed normally.booleanisDone()Checks if computation is done.voidlisten(IgniteInClosure lsnr)Registers listener closure to be asynchronously notified whenever future completes.voidlisten(IgniteRunnable lsnr)Registers listener closure to be asynchronously notified whenever future completes.Objectresult()
-
-
-
Constructor Detail
-
ComputeConvertingFuture
public ComputeConvertingFuture(ComputeTaskFuture fut)
Ctor.- Parameters:
fut- Future to wrap.
-
-
Method Detail
-
get
public Object get() throws IgniteCheckedException
Synchronously waits for completion of the computation and returns computation result.- Specified by:
getin interfaceIgniteInternalFuture- Returns:
- Computation result.
- Throws:
IgniteInterruptedCheckedException- Subclass ofIgniteCheckedExceptionthrown if the wait was interrupted.IgniteFutureCancelledCheckedException- Subclass ofIgniteCheckedExceptionthrows if computation was cancelled.IgniteCheckedException- If computation failed.
-
get
public Object get(long timeout) throws IgniteCheckedException
Synchronously waits for completion of the computation for up to the timeout specified and returns computation result. This method is equivalent to callingget(long, TimeUnit.MILLISECONDS).- Specified by:
getin interfaceIgniteInternalFuture- Parameters:
timeout- The maximum time to wait in milliseconds.- Returns:
- Computation result.
- Throws:
IgniteInterruptedCheckedException- Subclass ofIgniteCheckedExceptionthrown if the wait was interrupted.IgniteFutureTimeoutCheckedException- Subclass ofIgniteCheckedExceptionthrown if the wait was timed out.IgniteFutureCancelledCheckedException- Subclass ofIgniteCheckedExceptionthrows if computation was cancelled.IgniteCheckedException- If computation failed.
-
get
public Object get(long timeout, TimeUnit unit) throws IgniteCheckedException
Synchronously waits for completion of the computation for up to the timeout specified and returns computation result.- Specified by:
getin interfaceIgniteInternalFuture- Parameters:
timeout- The maximum time to wait.unit- The time unit of thetimeoutargument.- Returns:
- Computation result.
- Throws:
IgniteInterruptedCheckedException- Subclass ofIgniteCheckedExceptionthrown if the wait was interrupted.IgniteFutureTimeoutCheckedException- Subclass ofIgniteCheckedExceptionthrown if the wait was timed out.IgniteFutureCancelledCheckedException- Subclass ofIgniteCheckedExceptionthrows if computation was cancelled.IgniteCheckedException- If computation failed.
-
getUninterruptibly
public Object getUninterruptibly() throws IgniteCheckedException
Synchronously waits for completion of the computation and returns computation result ignoring interrupts.- Specified by:
getUninterruptiblyin interfaceIgniteInternalFuture- Returns:
- Computation result.
- Throws:
IgniteFutureCancelledCheckedException- Subclass ofIgniteCheckedExceptionthrows if computation was cancelled.IgniteCheckedException- If computation failed.
-
cancel
public boolean cancel() throws IgniteCheckedExceptionCancels this future.- Specified by:
cancelin interfaceIgniteInternalFuture- Returns:
Trueif future was canceled (i.e. was not finished prior to this call).- Throws:
IgniteCheckedException- If cancellation failed.
-
isDone
public boolean isDone()
Checks if computation is done.- Specified by:
isDonein interfaceIgniteInternalFuture- Returns:
Trueif computation is done,falseotherwise.
-
isCancelled
public boolean isCancelled()
Returnstrueif this computation was cancelled before it completed normally.- Specified by:
isCancelledin interfaceIgniteInternalFuture- Returns:
Trueif this computation was cancelled before it completed normally.
-
listen
public void listen(IgniteInClosure lsnr)
Registers listener closure to be asynchronously notified whenever future completes.- Specified by:
listenin interfaceIgniteInternalFuture- Parameters:
lsnr- Listener closure to register.
-
listen
public void listen(IgniteRunnable lsnr)
Registers listener closure to be asynchronously notified whenever future completes.- Specified by:
listenin interfaceIgniteInternalFuture- Parameters:
lsnr- Listener closure to register.
-
chain
public IgniteInternalFuture chain(IgniteClosure doneCb)
Make a chained future to convert result of this future (when complete) into a new format. It is guaranteed that done callback will be called only ONCE.- Specified by:
chainin interfaceIgniteInternalFuture- Parameters:
doneCb- Done callback that is applied to this future when it finishes to produce chained future result.- Returns:
- Chained future that finishes after this future completes and done callback is called.
-
chain
public IgniteInternalFuture chain(IgniteOutClosure doneCb)
Make a chained future to convert result of this future (when complete) into a new format. It is guaranteed that done callback will be called only ONCE.- Specified by:
chainin interfaceIgniteInternalFuture- Parameters:
doneCb- Done callback that is applied to this future when it finishes to produce chained future result.- Returns:
- Chained future that finishes after this future completes and done callback is called.
-
chain
public IgniteInternalFuture chain(IgniteClosure doneCb, Executor exec)
Make a chained future to convert result of this future (when complete) into a new format. It is guaranteed that done callback will be called only ONCE.- Specified by:
chainin interfaceIgniteInternalFuture- Parameters:
doneCb- Done callback that is applied to this future when it finishes to produce chained future result.exec- Executor to run callback.- Returns:
- Chained future that finishes after this future completes and done callback is called.
-
chain
public IgniteInternalFuture chain(IgniteOutClosure doneCb, Executor exec)
Make a chained future to convert result of this future (when complete) into a new format. It is guaranteed that done callback will be called only ONCE.- Specified by:
chainin interfaceIgniteInternalFuture- Parameters:
doneCb- Done callback that is applied to this future when it finishes to produce chained future result.exec- Executor to run callback.- Returns:
- Chained future that finishes after this future completes and done callback is called.
-
chainCompose
public IgniteInternalFuture chainCompose(IgniteClosure doneCb)
Make a chained future that is completed whendoneCbis executed. Callback is called with this future as the argument, when this future completes. It is guaranteed that done callback will be called only ONCE.- Specified by:
chainComposein interfaceIgniteInternalFuture- Parameters:
doneCb- Done callback.- Returns:
- Chained future.
-
chainCompose
public IgniteInternalFuture chainCompose(IgniteClosure doneCb, @Nullable @Nullable Executor exec)
Make a chained future that is completed whendoneCbis executed. Callback is called with this future as the argument, when this future completes. It is guaranteed that done callback will be called only ONCE.- Specified by:
chainComposein interfaceIgniteInternalFuture- Parameters:
doneCb- Done callback.exec- Executor to run callback.- Returns:
- Chained future.
-
error
public Throwable error()
- Specified by:
errorin interfaceIgniteInternalFuture- Returns:
- Error value if future has already been completed with error.
-
result
public Object result()
- Specified by:
resultin interfaceIgniteInternalFuture- Returns:
- Result value if future has already been completed normally.
-
-