Class KeyedStateBootstrapFunction<K,IN>
java.lang.Object
org.apache.flink.api.common.functions.AbstractRichFunction
org.apache.flink.state.api.functions.KeyedStateBootstrapFunction<K,IN>
- Type Parameters:
K- Type of the keys.IN- Type of the input.
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function,org.apache.flink.api.common.functions.RichFunction
@PublicEvolving
public abstract class KeyedStateBootstrapFunction<K,IN>
extends org.apache.flink.api.common.functions.AbstractRichFunction
A function that writes keyed state to a new operator.
For every element #processElement(Object, Context) is invoked. This can write data to
state and set timers.
NOTE: A KeyedStateBootstrapFunction is always a RichFunction. Therefore, access to the RuntimeContext is always available and setup and teardown
methods can be implemented. See RichFunction.open(OpenContext) and RichFunction.close().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassInformation available in an invocation of#processElement(Object, Context). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidprocessElement(IN value, KeyedStateBootstrapFunction<K, IN>.Context ctx) Process one element from the input stream.Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
-
Constructor Details
-
KeyedStateBootstrapFunction
public KeyedStateBootstrapFunction()
-
-
Method Details
-
processElement
public abstract void processElement(IN value, KeyedStateBootstrapFunction<K, IN>.Context ctx) throws ExceptionProcess one element from the input stream.This function can update internal state or set timers using the
KeyedStateBootstrapFunction<K,parameter.IN>.Context - Parameters:
value- The input value.ctx- AKeyedStateBootstrapFunction<K,that allows querying the timestamp of the element and getting aIN>.Context TimerServicefor registering timers and querying the time. The context is only valid during the invocation of this method, do not store it.- Throws:
Exception- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-