public interface StateInternals
StateInternals describes the functionality a runner needs to provide for the
State API to be supported.
The SDK will only use this after elements have been partitioned by key. For instance, after a
GroupByKey operation. The runner implementation must ensure that any writes using
StaeIntetrnals are implicitly scoped to the key being processed and the specific step
accessing state.
The runner implementation must also ensure that any writes to the associated state objects are persisted together with the completion status of the processing that produced these writes.
This is a low-level API intended for use by the Dataflow SDK. It should not be used directly, and is highly likely to change.
| Modifier and Type | Method and Description |
|---|---|
<T extends MergeableState<?,?>> |
mergedState(Iterable<StateNamespace> sourceNamespaces,
StateNamespace resultNamespace,
StateTag<T> address)
Return state that reads from all the source namespaces.
|
<T extends State> |
state(StateNamespace namespace,
StateTag<T> address)
Return the state associated with
address in the specified namespace. |
<T extends State> T state(StateNamespace namespace, StateTag<T> address)
address in the specified namespace.<T extends MergeableState<?,?>> T mergedState(Iterable<StateNamespace> sourceNamespaces, StateNamespace resultNamespace, StateTag<T> address)
Merging state is potentially destructive, in that it may move information from the
sourceNamespaces to resultNamespace. As a result, after calling this all
future calls should include as their namespaces a superset of
sourceNamespaces and resultNamespace.