T
- @Internal public class FirstReducer<T> extends Object implements GroupReduceFunction<T,T>, GroupCombineFunction<T,T>
Constructor and Description |
---|
FirstReducer(int n) |
Modifier and Type | Method and Description |
---|---|
void |
combine(Iterable<T> values,
Collector<T> out)
The combine method, called (potentially multiple timed) with subgroups of elements.
|
void |
reduce(Iterable<T> values,
Collector<T> out)
The reduce method.
|
public void reduce(Iterable<T> values, Collector<T> out) throws Exception
GroupReduceFunction
reduce
in interface GroupReduceFunction<T,T>
values
- All records that belong to the given input key.out
- The collector to hand results to.Exception
- This method may throw exceptions. Throwing an exception will cause the
operation to fail and may trigger recovery.public void combine(Iterable<T> values, Collector<T> out) throws Exception
GroupCombineFunction
combine
in interface GroupCombineFunction<T,T>
values
- The elements to be combined.out
- The collector to use to return values from the function.Exception
- The function may throw Exceptions, which will cause the program to cancel,
and may trigger the recovery logic.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.