Interface TwoInputNonBroadcastStreamProcessFunction<IN1,IN2,OUT>
- All Superinterfaces:
org.apache.flink.api.common.functions.Function,ProcessFunction,Serializable
- All Known Subinterfaces:
TwoInputNonBroadcastEventTimeStreamProcessFunction<IN1,IN2, OUT>
@Experimental
public interface TwoInputNonBroadcastStreamProcessFunction<IN1,IN2,OUT>
extends ProcessFunction
This contains all logical related to process records from two non-broadcast input.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidThis is a life-cycle method indicates that this function will no longer receive any data from the first input.default voidThis is a life-cycle method indicates that this function will no longer receive any data from the second input.default voidonProcessingTimer(long timestamp, Collector<OUT> output, PartitionedContext<OUT> ctx) Callback for processing timer.default org.apache.flink.api.common.watermark.WatermarkHandlingResultonWatermarkFromFirstInput(org.apache.flink.api.common.watermark.Watermark watermark, Collector<OUT> output, NonPartitionedContext<OUT> ctx) Callback function when receive the watermark from the first input.default org.apache.flink.api.common.watermark.WatermarkHandlingResultonWatermarkFromSecondInput(org.apache.flink.api.common.watermark.Watermark watermark, Collector<OUT> output, NonPartitionedContext<OUT> ctx) Callback function when receive the watermark from the second input.default voidopen(NonPartitionedContext<OUT> ctx) Initialization method for the function.voidprocessRecordFromFirstInput(IN1 record, Collector<OUT> output, PartitionedContext<OUT> ctx) Process record from the first input and emit data throughCollector.voidprocessRecordFromSecondInput(IN2 record, Collector<OUT> output, PartitionedContext<OUT> ctx) Process record from the second input and emit data throughCollector.Methods inherited from interface org.apache.flink.datastream.api.function.ProcessFunction
close, declareWatermarks, usesStates
-
Method Details
-
open
Initialization method for the function. It is called before the actual working methods (like processRecord) and thus suitable for one time setup work.By default, this method does nothing.
- Throws:
Exception- Implementations may forward exceptions, which are caught by the runtime. When the runtime catches an exception, it aborts the task and lets the fail-over logic decide whether to retry the task execution.
-
processRecordFromFirstInput
void processRecordFromFirstInput(IN1 record, Collector<OUT> output, PartitionedContext<OUT> ctx) throws Exception Process record from the first input and emit data throughCollector.- Parameters:
record- to process.output- to emit processed records.ctx- runtime context in which this function is executed.- Throws:
Exception
-
processRecordFromSecondInput
void processRecordFromSecondInput(IN2 record, Collector<OUT> output, PartitionedContext<OUT> ctx) throws Exception Process record from the second input and emit data throughCollector.- Parameters:
record- to process.output- to emit processed records.ctx- runtime context in which this function is executed.- Throws:
Exception
-
endFirstInput
This is a life-cycle method indicates that this function will no longer receive any data from the first input.- Parameters:
ctx- the context in which this function is executed.- Throws:
Exception
-
endSecondInput
This is a life-cycle method indicates that this function will no longer receive any data from the second input.- Parameters:
ctx- the context in which this function is executed.- Throws:
Exception
-
onProcessingTimer
default void onProcessingTimer(long timestamp, Collector<OUT> output, PartitionedContext<OUT> ctx) throws Exception Callback for processing timer.- Parameters:
timestamp- when this callback is triggered.output- to emit record.ctx- runtime context in which this function is executed.- Throws:
Exception
-
onWatermarkFromFirstInput
default org.apache.flink.api.common.watermark.WatermarkHandlingResult onWatermarkFromFirstInput(org.apache.flink.api.common.watermark.Watermark watermark, Collector<OUT> output, NonPartitionedContext<OUT> ctx) throws Exception Callback function when receive the watermark from the first input.- Parameters:
watermark- to process.output- to emit record.ctx- runtime context in which this function is executed.- Throws:
Exception
-
onWatermarkFromSecondInput
default org.apache.flink.api.common.watermark.WatermarkHandlingResult onWatermarkFromSecondInput(org.apache.flink.api.common.watermark.Watermark watermark, Collector<OUT> output, NonPartitionedContext<OUT> ctx) throws Exception Callback function when receive the watermark from the second input.- Parameters:
watermark- to process.output- to emit record.ctx- runtime context in which this function is executed.- Throws:
Exception
-