Interface ProcessFunction
-
- All Superinterfaces:
org.apache.flink.api.common.functions.Function,Serializable
- All Known Subinterfaces:
OneInputStreamProcessFunction<IN,OUT>,TwoInputBroadcastStreamProcessFunction<IN1,IN2,OUT>,TwoInputNonBroadcastStreamProcessFunction<IN1,IN2,OUT>,TwoOutputStreamProcessFunction<IN,OUT1,OUT2>
@Experimental public interface ProcessFunction extends org.apache.flink.api.common.functions.FunctionBase class for all user defined process functions.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidclose()Tear-down method for the user code.default voidopen()Initialization method for the function.default Set<org.apache.flink.api.common.state.StateDeclaration>usesStates()Explicitly declares states upfront.
-
-
-
Method Detail
-
open
default void open() throws ExceptionInitialization 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.
-
usesStates
default Set<org.apache.flink.api.common.state.StateDeclaration> usesStates()
Explicitly declares states upfront. Each specific state must be declared in this method before it can be used.- Returns:
- all declared states used by this process function.
-
close
default void close() throws ExceptionTear-down method for the user code. It is called after the last call to the main working methods (e.g. processRecord).This method can be used for clean up work.
- 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.
-
-