|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openspaces.core.executor.support.SimpleDelegatingTask<T> org.openspaces.core.executor.support.AbstractDelegatingDistributedTask<T,R> org.openspaces.core.executor.support.AvgTask<T,R>
public class AvgTask<T extends Number,R extends Number>
A sum distrubted task that accepts a Task
to delegate
the actual execution to and implements the reduce(java.util.List)
operation.
By defualt, 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 optioanl AsyncResultFilter
.
SumReducer
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from interface com.gigaspaces.async.AsyncResultFilter |
---|
AsyncResultFilter.Decision |
Constructor Summary | |
---|---|
AvgTask()
Here for externalizable. |
|
AvgTask(Class<R> reduceType,
Task<T> task)
Constructs a new sum distributed task that delegates the actual execution to th provided task. |
|
AvgTask(Class<R> reduceType,
Task<T> task,
AsyncResultFilter<T> filter)
Constructs a new sum distributed task that delegates the actual execution to th provided task. |
Method Summary | |
---|---|
AvgTask |
ignoreExceptions()
Sests 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)
|
Methods inherited from class org.openspaces.core.executor.support.AbstractDelegatingDistributedTask |
---|
_readExternal, _writeExternal, getFilter, onResult |
Methods inherited from class org.openspaces.core.executor.support.SimpleDelegatingTask |
---|
execute, getDelegatedTask, getRouting |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.openspaces.core.executor.Task |
---|
execute |
Constructor Detail |
---|
public AvgTask()
public AvgTask(Class<R> reduceType, Task<T> task) throws IllegalArgumentException
task
- The task to delegate the execution to.
IllegalArgumentException
public AvgTask(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 result
IllegalArgumentException
Method Detail |
---|
public AvgTask ignoreExceptions()
reduce(java.util.List)
to ignore failed invocations.
public R reduce(List<AsyncResult<T>> results) throws Exception
SumReducer
.
reduce
in interface AsyncResultsReducer<T extends Number,R extends Number>
Exception
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |