R - Type of the task result returning from GridComputeTask.reduce(List) method.public class GridTaskFutureImpl<R> extends GridFutureAdapter<R> implements GridComputeTaskFuture<R>
AbstractQueuedSynchronizer.ConditionObjectlog| Constructor and Description |
|---|
GridTaskFutureImpl()
Required by
Externalizable. |
GridTaskFutureImpl(GridComputeTaskSession ses,
GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
Default no-op implementation that always returns
false. |
boolean |
cancelOnMasterLeave()
Cancel task on master leave event.
|
GridComputeTaskSession |
getTaskSession()
Gets task timeout.
|
boolean |
isMapped()
Checks if "map" step has completed (which means that
GridComputeTask.map(List, Object)
method has finished). |
boolean |
onCancelled()
Callback to notify that future is cancelled.
|
boolean |
onDone(R res,
Throwable err)
Callback to notify that future is finished.
|
void |
onMapped()
Callback for completion of task mapping stage.
|
void |
readExternal(ObjectInput in) |
String |
toString() |
boolean |
waitForMap()
Waits until
GridComputeTask.map(List, Object) method completes. |
boolean |
waitForMap(long timeout)
Waits for a specified timeout in milliseconds for
GridComputeTask.map(List, Object)
method to complete. |
boolean |
waitForMap(long timeout,
TimeUnit unit)
Waits for a specified timeout in milliseconds for
GridComputeTask.map(List, Object)
method to complete. |
void |
writeExternal(ObjectOutput out) |
chain, checkValid, concurrentNotify, concurrentNotify, duration, endTime, error, get, get, get, get0, isCancelled, isDone, isFailed, isValid, listenAsync, onDone, onDone, onDone, result, startTime, stopListenAsync, syncNotify, syncNotify, tryAcquireShared, tryReleaseSharedacquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryReleasegetExclusiveOwnerThread, setExclusiveOwnerThreadclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitget, get, getchain, concurrentNotify, concurrentNotify, duration, isCancelled, isDone, listenAsync, startTime, stopListenAsync, syncNotify, syncNotifypublic GridTaskFutureImpl()
Externalizable.public GridTaskFutureImpl(GridComputeTaskSession ses, GridKernalContext ctx)
ses - Task session instance.ctx - Kernal context.public GridComputeTaskSession getTaskSession()
getTaskSession in interface GridComputeTaskFuture<R>public boolean cancel()
throws GridException
false.
Futures that do support cancellation should override this method
and call GridFutureAdapter.onCancelled() callback explicitly if cancellation
indeed did happen.cancel in interface GridFuture<R>cancel in class GridFutureAdapter<R>True if future was canceled (i.e. was not finished prior to this call).GridException - If cancellation failed.public boolean cancelOnMasterLeave()
throws GridException
True if future was cancelled (i.e. was not finished prior to this call).GridException - If failed.public boolean isMapped()
GridComputeTask.map(List, Object)
method has finished).isMapped in interface GridComputeTaskFuture<R>true if map step has completed.public void onMapped()
public boolean onDone(@Nullable R res, @Nullable Throwable err)
null exception is passed in
the result value will be ignored.onDone in class GridFutureAdapter<R>res - Optional result.err - Optional error.True if result was set by this call.public boolean onCancelled()
onCancelled in class GridFutureAdapter<R>True if cancel flag was set by this call.public boolean waitForMap()
throws GridException
GridComputeTask.map(List, Object) method completes. This may be useful
when it is desired to know the list of all job siblings for the task, as list
of job siblings gets finalized only after the map step completes.
Note that this method will also return if the task fails.
waitForMap in interface GridComputeTaskFuture<R>true if map step has completed, false otherwise.GridException - If got interrupted while waiting or any other failure.public boolean waitForMap(long timeout)
throws GridException
GridComputeTask.map(List, Object)
method to complete. This may be useful when it is desired to know the list of all
job siblings for the task, as list of job siblings gets finalized only after the map
step completes.waitForMap in interface GridComputeTaskFuture<R>timeout - Maximum time to wait.true if map step has completed, false otherwise.GridException - If got interrupted while waiting or any other failure.public boolean waitForMap(long timeout,
TimeUnit unit)
throws GridException
GridComputeTask.map(List, Object)
method to complete. This may be useful when it is desired to know the list of all
job siblings for the task, as list of job siblings gets finalized only after the map
step completes.waitForMap in interface GridComputeTaskFuture<R>timeout - Maximum time to wait.unit - Time unit for time parameter.true if map step has completed, false otherwise.GridException - If got interrupted while waiting or any other failure.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizablewriteExternal in class GridFutureAdapter<R>IOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class GridFutureAdapter<R>IOExceptionClassNotFoundExceptionpublic String toString()
toString in class GridFutureAdapter<R>Copyright © 2014. All rights reserved.