public abstract class PlatformAbstractTask extends Object implements ComputeTask<Object,Void>
Modifier and Type | Field and Description |
---|---|
protected PlatformContext |
ctx
Platform context.
|
protected boolean |
done
Done flag.
|
protected ReadWriteLock |
lock
Lock for safe access to native pointers.
|
protected long |
taskPtr
Pointer to the task in the native platform.
|
Modifier | Constructor and Description |
---|---|
protected |
PlatformAbstractTask(PlatformContext ctx,
long taskPtr)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
onDone(Exception e)
Callback invoked when task future is completed and all resources could be safely cleaned up.
|
Void |
reduce(List<ComputeJobResult> results)
Reduces (or aggregates) results received so far into one compound result to be returned to
caller via
ComputeTaskFuture.get() method. |
ComputeJobResultPolicy |
result(ComputeJobResult res,
List<ComputeJobResult> rcvd)
Asynchronous callback invoked every time a result from remote execution is
received.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
map
protected final PlatformContext ctx
protected final long taskPtr
protected final ReadWriteLock lock
protected boolean done
protected PlatformAbstractTask(PlatformContext ctx, long taskPtr)
ctx
- Platform context.taskPtr
- Task pointer.public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd)
ComputeJobResultPolicy
for more information about result policies.result
in interface ComputeTask<Object,Void>
res
- Received remote grid executable result.rcvd
- All previously received results. Note that if task class has
ComputeTaskNoResultCache
annotation, then this list will be empty.@Nullable public Void reduce(List<ComputeJobResult> results)
ComputeTaskFuture.get()
method.
Note, that if some jobs did not succeed and could not be failed over then the list of results passed into this method will include the failed results. Otherwise, failed results will not be in the list.
reduce
in interface ComputeTask<Object,Void>
results
- Received results of broadcasted remote executions. Note that if task class has
ComputeTaskNoResultCache
annotation, then this list will be empty.public void onDone(Exception e)
e
- If failed.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017