Class FlinkStateInternals<K>
- java.lang.Object
-
- org.apache.beam.runners.flink.translation.wrappers.streaming.state.FlinkStateInternals<K>
-
- All Implemented Interfaces:
org.apache.beam.runners.core.StateInternals
public class FlinkStateInternals<K> extends java.lang.Object implements org.apache.beam.runners.core.StateInternalsStateInternalsthat uses a FlinkKeyedStateBackendto manage state.Note: In the Flink streaming runner the key is always encoded using an
Coderand stored in aFlinkKey.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFlinkStateInternals.EarlyBinderEagerly create user state to work around https://jira.apache.org/jira/browse/FLINK-12653.static classFlinkStateInternals.FlinkStateNamespaceKeySerializer
-
Constructor Summary
Constructors Constructor Description FlinkStateInternals(org.apache.flink.runtime.state.KeyedStateBackend<FlinkKey> flinkStateBackend, org.apache.beam.sdk.coders.Coder<K> keyCoder, org.apache.beam.sdk.coders.Coder<? extends org.apache.beam.sdk.transforms.windowing.BoundedWindow> windowCoder, org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWatermarkHoldUsage(org.joda.time.Instant watermarkHold)voidclearGlobalState()Allows to clear all state for the global watermark when the maximum watermark arrives.KgetKey()java.lang.LongminWatermarkHoldMs()Returns the minimum over all watermark holds.voidremoveWatermarkHoldUsage(org.joda.time.Instant watermarkHold)<T extends org.apache.beam.sdk.state.State>
Tstate(org.apache.beam.runners.core.StateNamespace namespace, org.apache.beam.runners.core.StateTag<T> address, org.apache.beam.sdk.state.StateContext<?> context)
-
-
-
Constructor Detail
-
FlinkStateInternals
public FlinkStateInternals(org.apache.flink.runtime.state.KeyedStateBackend<FlinkKey> flinkStateBackend, org.apache.beam.sdk.coders.Coder<K> keyCoder, org.apache.beam.sdk.coders.Coder<? extends org.apache.beam.sdk.transforms.windowing.BoundedWindow> windowCoder, org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
minWatermarkHoldMs
public java.lang.Long minWatermarkHoldMs()
Returns the minimum over all watermark holds.
-
getKey
public K getKey()
- Specified by:
getKeyin interfaceorg.apache.beam.runners.core.StateInternals
-
state
public <T extends org.apache.beam.sdk.state.State> T state(org.apache.beam.runners.core.StateNamespace namespace, org.apache.beam.runners.core.StateTag<T> address, org.apache.beam.sdk.state.StateContext<?> context)- Specified by:
statein interfaceorg.apache.beam.runners.core.StateInternals
-
clearGlobalState
public void clearGlobalState()
Allows to clear all state for the global watermark when the maximum watermark arrives. We do not clean up the global window state via timers which would lead to an unbounded number of keys and cleanup timers. Instead, the cleanup code below should be run when we finally receive the max watermark.
-
addWatermarkHoldUsage
public void addWatermarkHoldUsage(org.joda.time.Instant watermarkHold)
-
removeWatermarkHoldUsage
public void removeWatermarkHoldUsage(org.joda.time.Instant watermarkHold)
-
-