/** * No default implementation provided. * This method must be overridden by reduce stubs that want to make use of the combining feature. * In addition, the ReduceFunction extending class must be annotated as Combinable. * Note that this function must be implemented, if the reducer is annotated as combinable. * <p> * The use of the combiner is typically a pre-reduction of the data. It works similar as the reducer, only that is * is not guaranteed to see all values with the same key in one call to the combine function. Since it is called * prior to the <code>reduce()</code> method, input and output types of the combine method are the input types of * the <code>reduce()</code> method. * * @see eu.stratosphere.api.java.record.operators.ReduceOperator.Combinable * @param records * The records to be combined. Unlike in the reduce method, these are not necessarily all records * belonging to the given key. * @param out The collector to write the result to. * * @throws Exception Implementations may forward exceptions, which are caught by the runtime. When the * runtime catches an exception, it aborts the combine task and lets the fail-over logic * decide whether to retry the combiner execution. */ @Override public void combine(Iterator<Record> records, Collector<Record> out) throws Exception { // to be implemented, if the reducer should use a combiner. Note that the combining method // is only used, if the stub class is further annotated with the annotation // @ReduceOperator.Combinable reduce(records, out); } }