Interface OneInputStreamProcessFunction<IN,OUT>
-
- All Superinterfaces:
org.apache.flink.api.common.functions.Function,ProcessFunction,Serializable
- All Known Subinterfaces:
OneInputEventTimeStreamProcessFunction<IN,OUT>
@Experimental public interface OneInputStreamProcessFunction<IN,OUT> extends ProcessFunction
This contains all logical related to process records from single input.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidendInput(NonPartitionedContext<OUT> ctx)This is a life-cycle method indicates that this function will no longer receive any data from the input.default voidonProcessingTimer(long timestamp, Collector<OUT> output, PartitionedContext<OUT> ctx)Callback for processing timer.default org.apache.flink.api.common.watermark.WatermarkHandlingResultonWatermark(org.apache.flink.api.common.watermark.Watermark watermark, Collector<OUT> output, NonPartitionedContext<OUT> ctx)Callback function when receive watermark.default voidopen(NonPartitionedContext<OUT> ctx)Initialization method for the function.voidprocessRecord(IN record, Collector<OUT> output, PartitionedContext<OUT> ctx)Process record and emit data throughCollector.-
Methods inherited from interface org.apache.flink.datastream.api.function.ProcessFunction
close, declareWatermarks, usesStates
-
-
-
-
Method Detail
-
open
default void open(NonPartitionedContext<OUT> ctx) throws Exception
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.
-
processRecord
void processRecord(IN record, Collector<OUT> output, PartitionedContext<OUT> ctx) throws Exception
Process record and emit data throughCollector.- Parameters:
record- to process.output- to emit processed records.ctx- runtime context in which this function is executed.- Throws:
Exception
-
endInput
default void endInput(NonPartitionedContext<OUT> ctx) throws Exception
This is a life-cycle method indicates that this function will no longer receive any data from the 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 ExceptionCallback 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
-
-