public class GridStreamerStageExecutionFuture extends GridFutureAdapter<Object>
AbstractQueuedSynchronizer.ConditionObjectctx| Constructor and Description |
|---|
GridStreamerStageExecutionFuture()
Empty constructor required by
Externalizable. |
GridStreamerStageExecutionFuture(GridStreamerEx streamer,
GridUuid execId,
int failoverAttemptCnt,
long execStartTs,
GridUuid parentFutId,
Collection<UUID> prevExecNodes,
String stageName,
Collection<?> evts) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
Default no-op implementation that always returns
false. |
Map<UUID,GridStreamerExecutionBatch> |
childExecutions() |
Throwable |
error() |
Collection<Object> |
events() |
Collection<UUID> |
executionNodeIds() |
int |
failoverAttemptCount() |
GridUuid |
id() |
void |
map()
Sends execution requests to remote nodes or schedules local execution if events were mapped locally.
|
void |
metrics(GridStreamerMetricsHolder metricsHolder)
Sets metrics holder to update counters when future completes.
|
boolean |
onDone(Object res,
Throwable err)
Callback to notify that future is finished.
|
void |
onExecutionCompleted(UUID childNodeId,
Throwable err)
Callback invoked when child node reports execution is completed (successfully or not).
|
void |
onNodeLeft(UUID leftNodeId)
Callback invoked when node leaves the grid.
|
GridUuid |
parentFutureId()
If not root future, will return parent future ID.
|
boolean |
rootExecution() |
UUID |
senderNodeId()
If not root future, will return parent node ID (may be local node ID).
|
String |
stageName() |
String |
toString() |
chain, checkValid, concurrentNotify, concurrentNotify, duration, endTime, get, get, get, get0, isCancelled, isDone, isFailed, isValid, listenAsync, onCancelled, onDone, onDone, onDone, readExternal, result, startTime, stopListenAsync, syncNotify, syncNotify, tryAcquireShared, tryReleaseShared, writeExternalacquire, 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, setExclusiveOwnerThreadpublic GridStreamerStageExecutionFuture()
Externalizable.public GridStreamerStageExecutionFuture(GridStreamerEx streamer, @Nullable GridUuid execId, int failoverAttemptCnt, long execStartTs, @Nullable GridUuid parentFutId, @Nullable Collection<UUID> prevExecNodes, String stageName, Collection<?> evts)
streamer - Streamer extended context.execId - Execution ID. If parent future ID is null then this is a root future
and execution ID must be null.failoverAttemptCnt - Number of attempts this set of events was tried to failover.execStartTs - Execution start timestamp.parentFutId - Parent future ID.prevExecNodes - Node IDs on which pipeline was already executed.stageName - Stage name to run.evts - Events to process.public GridUuid id()
public void metrics(GridStreamerMetricsHolder metricsHolder)
metricsHolder - Metrics holder.public int failoverAttemptCount()
public String stageName()
public Collection<Object> events()
public void map()
public boolean rootExecution()
True if this future is a root execution future (i.e. initiated by streamer's addEvent call).@Nullable public UUID senderNodeId()
public GridUuid parentFutureId()
public Throwable error()
error in class GridFutureAdapter<Object>public Map<UUID,GridStreamerExecutionBatch> childExecutions()
public Collection<UUID> executionNodeIds()
public void onExecutionCompleted(UUID childNodeId, @Nullable Throwable err)
childNodeId - Child node ID.err - Exception if execution failed.public void onNodeLeft(UUID leftNodeId)
leftNodeId - Node ID that has left the grid.public boolean onDone(@Nullable Object res, @Nullable Throwable err)
null exception is passed in
the result value will be ignored.onDone in class GridFutureAdapter<Object>res - Optional result.err - Optional error.True if result was set by this call.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<Object>cancel in class GridFutureAdapter<Object>True if future was canceled (i.e. was not finished prior to this call).GridException - If cancellation failed.public String toString()
toString in class GridFutureAdapter<Object>Copyright © 2014. All rights reserved.