K
- Type of the keys.IN
- Type of the input.@PublicEvolving public abstract class KeyedStateBootstrapFunction<K,IN> extends AbstractRichFunction
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()
.
Modifier and Type | Class and Description |
---|---|
class |
KeyedStateBootstrapFunction.Context
Information available in an invocation of
processElement(Object, Context) . |
Constructor and Description |
---|
KeyedStateBootstrapFunction() |
Modifier and Type | Method and Description |
---|---|
abstract void |
processElement(IN value,
KeyedStateBootstrapFunction.Context ctx)
Process one element from the input stream.
|
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
open
public abstract void processElement(IN value, KeyedStateBootstrapFunction.Context ctx) throws Exception
This function can update internal state or set timers using the KeyedStateBootstrapFunction.Context
parameter.
value
- The input value.ctx
- A KeyedStateBootstrapFunction.Context
that allows querying the timestamp of the element and getting a
TimerService
for registering timers and querying the time. The context is only
valid during the invocation of this method, do not store it.Exception
- This method may throw exceptions. Throwing an exception will cause the
operation to fail and may trigger recovery.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.