Package org.apache.ignite.lang
Interface IgniteReducer<E,R>
- Type Parameters:
E- Type of collected values.R- Type of reduced value.
- All Superinterfaces:
Serializable
Defines generic reducer that collects multiple values and reduces them into one.
Reducers are useful in computations when results from multiple remote jobs need
to be reduced into one, e.g.
org.apache.ignite.IgniteCompute#call(Collection, IgniteReducer) method.-
Method Summary
-
Method Details
-
collect
Collects given value. If this method returnsfalsethenreduce()will be called right away. Otherwise caller will continue collecting until all values are processed.- Parameters:
e- Value to collect.- Returns:
trueto continue collecting,falseto instruct caller to stop collecting and callreduce()method.
-
reduce
R reduce()Reduces collected values into one.- Returns:
- Reduced value.
-