public class FlinkStateInternals<K>
extends java.lang.Object
implements org.apache.beam.runners.core.StateInternals
StateInternals that uses a Flink KeyedStateBackend to manage state.
Note: In the Flink streaming runner the key is always encoded using an Coder and
stored in a ByteBuffer.
| Modifier and Type | Class and Description |
|---|---|
static class |
FlinkStateInternals.EarlyBinder
Eagerly create user state to work around https://jira.apache.org/jira/browse/FLINK-12653.
|
| Constructor and Description |
|---|
FlinkStateInternals(org.apache.flink.runtime.state.KeyedStateBackend<java.nio.ByteBuffer> flinkStateBackend,
org.apache.beam.sdk.coders.Coder<K> keyCoder,
org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions) |
| Modifier and Type | Method and Description |
|---|---|
void |
addWatermarkHoldUsage(org.joda.time.Instant watermarkHold) |
void |
clearGlobalState()
Allows to clear all state for the global watermark when the maximum watermark arrives.
|
K |
getKey() |
java.lang.Long |
minWatermarkHoldMs()
Returns the minimum over all watermark holds.
|
void |
removeWatermarkHoldUsage(org.joda.time.Instant watermarkHold) |
<T extends org.apache.beam.sdk.state.State> |
state(org.apache.beam.runners.core.StateNamespace namespace,
org.apache.beam.runners.core.StateTag<T> address,
org.apache.beam.sdk.state.StateContext<?> context) |
public FlinkStateInternals(org.apache.flink.runtime.state.KeyedStateBackend<java.nio.ByteBuffer> flinkStateBackend,
org.apache.beam.sdk.coders.Coder<K> keyCoder,
org.apache.beam.runners.core.construction.SerializablePipelineOptions pipelineOptions)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Long minWatermarkHoldMs()
public K getKey()
getKey in interface org.apache.beam.runners.core.StateInternalspublic <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)
state in interface org.apache.beam.runners.core.StateInternalspublic void clearGlobalState()
public void addWatermarkHoldUsage(org.joda.time.Instant watermarkHold)
public void removeWatermarkHoldUsage(org.joda.time.Instant watermarkHold)