Interface IgniteReducer2<E1,E2,R>
-
- Type Parameters:
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.
- All Superinterfaces:
IgniteOutClosure<R>,Serializable
- All Known Subinterfaces:
R2<E1,E2,R>
- All Known Implementing Classes:
IgniteReducer2X,RX2
public interface IgniteReducer2<E1,E2,R> extends IgniteOutClosure<R>
Defines genericfor-allorreducetype of closure. Unlikefor-eachtype 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.
Thread Safety
Note that this interface does not impose or assume any specific thread-safety by its implementations. Each implementation can elect what type of thread-safety it provides, if any.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancollect(E1 e1, E2 e2)Collects given values.-
Methods inherited from interface org.apache.ignite.lang.IgniteOutClosure
apply
-
-
-
-
Method Detail
-
collect
boolean collect(@Nullable E1 e1, @Nullable E2 e2)Collects given values. All values will be reduced byIgniteOutClosure.apply()method.The
nulls could be passed if the data being collected is indeednull. If execution failed this method will not be called.- Parameters:
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.- Returns:
trueto continue collecting,falseto instruct caller to stop collecting and callIgniteOutClosure.apply()method.
-
-