public class CopyOnAccessInMemoryStateInternals<K> extends Object implements StateInternals<K>
StateInternals built on top of an underlying StateTable that contains instances
of InMemoryStateInternals.InMemoryState. Whenever state that exists in the underlying StateTable is
accessed, an independent copy will be created within this table.| Modifier and Type | Method and Description |
|---|---|
CopyOnAccessInMemoryStateInternals<K> |
commit()
Ensures this
CopyOnAccessInMemoryStateInternals is complete. |
org.joda.time.Instant |
getEarliestWatermarkHold()
Gets the earliest Watermark Hold present in this table.
|
K |
getKey() |
boolean |
isEmpty() |
<T extends State> |
state(StateNamespace namespace,
StateTag<? super K,T> address) |
<T extends State> |
state(StateNamespace namespace,
StateTag<? super K,T> address,
StateContext<?> c) |
static <K> CopyOnAccessInMemoryStateInternals<K> |
withUnderlying(K key,
CopyOnAccessInMemoryStateInternals<K> underlying)
Creates a new
CopyOnAccessInMemoryStateInternals with the underlying (possibly null)
StateInternals. |
public static <K> CopyOnAccessInMemoryStateInternals<K> withUnderlying(K key, @Nullable CopyOnAccessInMemoryStateInternals<K> underlying)
CopyOnAccessInMemoryStateInternals with the underlying (possibly null)
StateInternals.public CopyOnAccessInMemoryStateInternals<K> commit()
CopyOnAccessInMemoryStateInternals is complete. Other copies of state for
the same Step and Key may be discarded after invoking this method.
For each StateNamespace, for each address in that namespace that
has not been bound in this CopyOnAccessInMemoryStateInternals, put a reference to that
state within this StateInternals.
Additionally, stores the WatermarkHoldState with the earliest time bound in the
state table after the commit is completed, enabling calls to
getEarliestWatermarkHold().
public org.joda.time.Instant getEarliestWatermarkHold()
Must be called after this state has been committed. Will throw an
IllegalStateException if the state has not been committed.
public <T extends State> T state(StateNamespace namespace, StateTag<? super K,T> address)
state in interface StateInternals<K>public <T extends State> T state(StateNamespace namespace, StateTag<? super K,T> address, StateContext<?> c)
state in interface StateInternals<K>public K getKey()
getKey in interface StateInternals<K>public boolean isEmpty()
Copyright © 2016–2017 The Apache Software Foundation. All rights reserved.