public class SumTask<T extends Number,R extends Number> extends AbstractDelegatingDistributedTask<T,R> implements Externalizable
Task to delegate
 the actual execution to and implements the reduce(java.util.List) operation.
 By default, throws an exception if one of the execution fails. ignoreExceptions()
 can be called to only perform the operation on all the successful operations, ignoring the failed
 ones.
 
Can accept an optional AsyncResultFilter.
SumReducer, 
Serialized FormAsyncResultFilter.Decision| Constructor and Description | 
|---|
| SumTask() | 
| SumTask(Class<R> reduceType,
       Task<T> task)Constructs a new sum distributed task that delegates the actual execution to
 th provided task. | 
| SumTask(Class<R> reduceType,
       Task<T> task,
       AsyncResultFilter<T> filter)Constructs a new sum distributed task that delegates the actual execution to
 th provided task. | 
| Modifier and Type | Method and Description | 
|---|---|
| SumTask | ignoreExceptions()Sets the  reduce(java.util.List)to ignore failed invocations. | 
| void | readExternal(ObjectInput in) | 
| R | reduce(List<AsyncResult<T>> results)Performs the actual sum operation by delegating to its internal
  SumReducer. | 
| void | writeExternal(ObjectOutput out) | 
_readExternal, _writeExternal, getFilter, onResultexecute, getDelegatedTask, getRoutingpublic SumTask()
public SumTask(Class<R> reduceType, Task<T> task) throws IllegalArgumentException
task - The task to delegate the execution to.IllegalArgumentExceptionpublic SumTask(Class<R> reduceType, Task<T> task, AsyncResultFilter<T> filter) throws IllegalArgumentException
task - The task to delegate the execution to.filter - A result filter to be called for each resultIllegalArgumentExceptionpublic SumTask ignoreExceptions()
reduce(java.util.List) to ignore failed invocations.public R reduce(List<AsyncResult<T>> results) throws Exception
SumReducer.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionCopyright © GigaSpaces.