IN1 - Type of the first input.IN2 - Type of the second input.OUT - Output type.public interface CoReduceFunction<IN1,IN2,OUT> extends org.apache.flink.api.common.functions.Function, Serializable
ConnectedDataStreaminput = ...; ConnectedDataStream result = input.groupBy(keyPosition1, keyPosition2) .reduce(new MyCoReduceFunction(), keyPosition1, keyPosition2).addSink(...);
| Modifier and Type | Method and Description |
|---|---|
OUT |
map1(IN1 value)
Maps the reduced first input to the output type.
|
OUT |
map2(IN2 value)
Maps the reduced second input to the output type.
|
IN1 |
reduce1(IN1 value1,
IN1 value2)
The core method of CoReduceFunction, combining two values of the first
input into one value of the same type.
|
IN2 |
reduce2(IN2 value1,
IN2 value2)
The core method of ReduceFunction, combining two values of the second
input into one value of the same type.
|
IN1 reduce1(IN1 value1, IN1 value2) throws Exception
value1 - The first value to combine.value2 - The second value to combine.Exception - This method may throw exceptions. Throwing an exception will
cause the operation to fail and may trigger recovery.IN2 reduce2(IN2 value1, IN2 value2) throws Exception
value1 - The first value to combine.value2 - The second value to combine.Exception - This method may throw exceptions. Throwing an exception will
cause the operation to fail and may trigger recovery.OUT map1(IN1 value) throws Exception
value - Type of the first input.ExceptionCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.