public class MaxTask<T extends Number> extends AbstractDelegatingDistributedTask<T,T> 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.
MaxReducer,
Serialized FormAsyncResultFilter.Decision| Constructor and Description |
|---|
MaxTask() |
MaxTask(Class<T> reduceType,
Task<T> task)
Constructs a new sum distributed task that delegates the actual execution to th provided
task.
|
MaxTask(Class<T> 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 |
|---|---|
MaxTask |
ignoreExceptions()
Sets the
reduce(java.util.List) to ignore failed invocations. |
void |
readExternal(ObjectInput in) |
T |
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 MaxTask()
public MaxTask(Class<T> reduceType, Task<T> task) throws IllegalArgumentException
task - The task to delegate the execution to.IllegalArgumentExceptionpublic MaxTask(Class<T> 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 MaxTask ignoreExceptions()
reduce(java.util.List) to ignore failed invocations.public T 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.