@Experimental(value=STATE) public class StateTags extends Object
StateTag instances.| Modifier and Type | Method and Description |
|---|---|
static <T> StateTag<BagState<T>> |
bag(String id,
Coder<T> elemCoder)
Create a state tag that is optimized for adding values frequently, and
occasionally retrieving all the values that have been added.
|
static <InputT,AccumT,OutputT> |
combiningValue(String id,
Coder<AccumT> accumCoder,
Combine.CombineFn<InputT,AccumT,OutputT> combineFn)
Create a state tag for values that use a
Combine.CombineFn to automatically merge
multiple InputTs into a single OutputT. |
static <InputT,AccumT,OutputT> |
combiningValueFromInputInternal(String id,
Coder<InputT> inputCoder,
Combine.CombineFn<InputT,AccumT,OutputT> combineFn)
Create a state tag for values that use a
Combine.CombineFn to automatically merge
multiple InputTs into a single OutputT. |
static <StateT extends State> |
makeSystemTagInternal(StateTag<StateT> tag)
Convert an arbitrary
StateTag to a system-internal tag that is guaranteed not to
collide with any user tags. |
static <T> StateTag<ValueState<T>> |
value(String id,
Coder<T> valueCoder)
Create a simple state tag for values of type
T. |
static <T> StateTag<WatermarkStateInternal> |
watermarkStateInternal(String id)
Create a state tag for holding the watermark.
|
public static <T> StateTag<ValueState<T>> value(String id, Coder<T> valueCoder)
T.public static <InputT,AccumT,OutputT> StateTag<CombiningValueState<InputT,OutputT>> combiningValue(String id, Coder<AccumT> accumCoder, Combine.CombineFn<InputT,AccumT,OutputT> combineFn)
Combine.CombineFn to automatically merge
multiple InputTs into a single OutputT.public static <InputT,AccumT,OutputT> StateTag<CombiningValueState<InputT,OutputT>> combiningValueFromInputInternal(String id, Coder<InputT> inputCoder, Combine.CombineFn<InputT,AccumT,OutputT> combineFn)
Combine.CombineFn to automatically merge
multiple InputTs into a single OutputT.
This determines the Coder<AccumT> from the given Coder<InputT>, and
should only be used to initialize static values.
public static <T> StateTag<BagState<T>> bag(String id, Coder<T> elemCoder)
public static <T> StateTag<WatermarkStateInternal> watermarkStateInternal(String id)