E1 - Type of the first free variable, i.e. the element the closure is called on.E2 - Type of the second free variable, i.e. the element the closure is called on.R - Type of the closure's return value.public interface IgniteReducer2<E1,E2,R> extends IgniteOutClosure<R>
for-all or reduce type of closure. Unlike for-each type of closure
that returns optional value on each execution of the closure - the reducer returns a single
value for one or more collected values.
Closures are a first-class functions that are defined with (or closed over) their free variables that are bound to the closure scope at execution. Since Java 6 doesn't provide a language construct for first-class function the closures are implemented as abstract classes.
| Modifier and Type | Method and Description |
|---|---|
boolean |
collect(E1 e1,
E2 e2)
Collects given values.
|
applyboolean collect(@Nullable
E1 e1,
@Nullable
E2 e2)
IgniteOutClosure.apply() method.
The nulls could be passed if the data being collected is indeed null.
If execution failed this method will not be called.
e1 - First bound free variable, i.e. the element the closure is called on.e2 - Second bound free variable, i.e. the element the closure is called on.true to continue collecting, false to instruct caller to stop
collecting and call IgniteOutClosure.apply() method.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.1 Release Date : May 21 2020