Package org.apache.beam.fn.harness.state
Class BagUserState<T>
- java.lang.Object
-
- org.apache.beam.fn.harness.state.BagUserState<T>
-
public class BagUserState<T> extends java.lang.ObjectAn implementation of a bag user state that utilizes the Beam Fn State API to fetch, clear and persist values.Calling
asyncClose()schedules any required persistence changes. This object should no longer be used after it is closed.TODO: Move to an async persist model where persistence is signalled based upon cache memory pressure and its need to flush.
-
-
Constructor Summary
Constructors Constructor Description BagUserState(Cache<?,?> cache, BeamFnStateClient beamFnStateClient, java.lang.String instructionId, org.apache.beam.model.fnexecution.v1.BeamFnApi.StateKey stateKey, org.apache.beam.sdk.coders.Coder<T> valueCoder)The cache must be namespaced for this state object accordingly.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(T t)voidasyncClose()voidclear()org.apache.beam.sdk.fn.stream.PrefetchableIterable<T>get()
-
-
-
Constructor Detail
-
BagUserState
public BagUserState(Cache<?,?> cache, BeamFnStateClient beamFnStateClient, java.lang.String instructionId, org.apache.beam.model.fnexecution.v1.BeamFnApi.StateKey stateKey, org.apache.beam.sdk.coders.Coder<T> valueCoder)
The cache must be namespaced for this state object accordingly.
-
-