/** * Applies a GroupReduce transformation on a grouped and sorted {@link DataSet}.<br/> * The transformation calls a {@link GroupReduceFunction} for each group of the DataSet. * A GroupReduceFunction can iterate over all elements of a group and emit any * number of output elements including none. * * @param reducer The GroupReduceFunction that is applied on each group of the DataSet. * @return A GroupReduceOperator that represents the reduced DataSet. * * @see GroupReduceFunction * @see GroupReduceOperator * @see DataSet */ public <R> ReduceGroupOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) { if (reducer == null) { throw new NullPointerException("GroupReduce function must not be null."); } return new ReduceGroupOperator<T, R>(this, reducer); }
/** * Applies a GroupReduce transformation on a non-grouped {@link DataSet}.<br/> * The transformation calls a {@link GroupReduceFunction} once with the full DataSet. * The GroupReduceFunction can iterate over all elements of the DataSet and emit any * number of output elements including none. * * @param reducer The GroupReduceFunction that is applied on the DataSet. * @return A GroupReduceOperator that represents the reduced DataSet. * * @see GroupReduceFunction * @see GroupReduceOperator * @see DataSet */ public <R> ReduceGroupOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) { if (reducer == null) { throw new NullPointerException("GroupReduce function must not be null."); } return new ReduceGroupOperator<T, R>(this, reducer); }
/** * Applies a GroupReduce transformation on a grouped {@link DataSet}.<br/> * The transformation calls a {@link GroupReduceFunction} for each group of the DataSet. * A GroupReduceFunction can iterate over all elements of a group and emit any * number of output elements including none. * * @param reducer The GroupReduceFunction that is applied on each group of the DataSet. * @return A GroupReduceOperator that represents the reduced DataSet. * * @see GroupReduceFunction * @see GroupReduceOperator * @see DataSet */ public <R> ReduceGroupOperator<T, R> reduceGroup(GroupReduceFunction<T, R> reducer) { if (reducer == null) { throw new NullPointerException("GroupReduce function must not be null."); } return new ReduceGroupOperator<T, R>(this, reducer); }