org.apache.ignite.lang

## Interface IgniteReducer<E,R>

Type Parameters:
  `E` - Type of collected values.
  `R` - Type of reduced value.

All Superinterfaces:
  Serializable

All Known Subinterfaces:
  R1<E1,R>

All Known Implementing Classes:
  AlwaysTrueReducer, IgniteReducerX, IntSumReducer, LongSumReducer, RX1, StringConcatReducer

    public interface IgniteReducer<E,R>
    extends 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. `IgniteCompute.call(Collection, IgniteReducer)` method.

### Method Summary

Methods
`boolean` `collect(E e)` Collects given value.
`R` `reduce()` Reduces collected values into one.

### Method Detail

#### collect

    boolean collect(@Nullable
                  E e)

Collects given value. If this method returns `false` then `reduce()` will be called right away. Otherwise caller will continue collecting until all values are processed.

Parameters:
  `e` - Value to collect.
Returns:
  `true` to continue collecting, `false` to instruct caller to stop collecting and call `reduce()` method.

#### reduce

    R reduce()

Reduces collected values into one.

Returns:
  Reduced value.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.1.0
Release Date | : July 20 2017