Class DeclaringAsyncKeyedProcessFunction<K,I,O>

java.lang.Object
org.apache.flink.api.common.functions.AbstractRichFunction
org.apache.flink.streaming.api.functions.KeyedProcessFunction<K,I,O>
org.apache.flink.runtime.asyncprocessing.functions.DeclaringAsyncKeyedProcessFunction<K,I,O>
Type Parameters:
K - Type of the key.
I - Type of the input elements.
O - Type of the output elements.
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction

@Internal public abstract class DeclaringAsyncKeyedProcessFunction<K,I,O> extends KeyedProcessFunction<K,I,O>
A keyed function that processes elements of a stream. This works with AsyncKeyedProcessOperator using the async state access and declares the processing logic as FLIP-455 describes. This function extends from the non-declaring KeyedProcessFunction for the convenience of unifying logic in the operator AsyncKeyedProcessOperator. Maybe later we could extract the common part KeyedProcessFunction and this class to a base class, and deviate from that.

For every element in the input stream the process declareProcess(org.apache.flink.runtime.asyncprocessing.declare.DeclarationContext, org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context, org.apache.flink.util.Collector<O>) declared is invoked. This can produce zero or more elements as output. Implementations can also query the time and set timers through the provided KeyedProcessFunction<K,I,O>.Context. For firing timers the process declareOnTimer(org.apache.flink.runtime.asyncprocessing.declare.DeclarationContext, org.apache.flink.streaming.api.functions.KeyedProcessFunction.OnTimerContext, org.apache.flink.util.Collector<O>) declared will be invoked. This can again produce zero or more elements as output and register further timers.

NOTE: Access to keyed state and timers (which are also scoped to a key) is only available if the DeclaringAsyncKeyedProcessFunction is applied on a KeyedStream.

See Also: