Class StateSpecs
StateSpecs
.-
Method Summary
Modifier and TypeMethodDescriptionbag()
Identical tobag()
, but with an element coder explicitly supplied.static <InputT,
AccumT, OutputT>
StateSpec<CombiningState<InputT, AccumT, OutputT>> combining
(Coder<AccumT> accumCoder, Combine.CombineFn<InputT, AccumT, OutputT> combineFn) Identical tocombining(CombineFn)
, but with an accumulator coder explicitly supplied.static <InputT,
AccumT, OutputT>
StateSpec<CombiningState<InputT, AccumT, OutputT>> combining
(Coder<AccumT> accumCoder, CombineWithContext.CombineFnWithContext<InputT, AccumT, OutputT> combineFn) For internal use only; no backwards compatibility guaranteesstatic <InputT,
AccumT, OutputT>
StateSpec<CombiningState<InputT, AccumT, OutputT>> combining
(Combine.CombineFn<InputT, AccumT, OutputT> combineFn) Create aStateSpec
for aCombiningState
which uses aCombine.CombineFn
to automatically merge multiple values of typeInputT
into a single resultingOutputT
.static <InputT,
AccumT, OutputT>
StateSpec<CombiningState<InputT, AccumT, OutputT>> combining
(CombineWithContext.CombineFnWithContext<InputT, AccumT, OutputT> combineFn) For internal use only; no backwards compatibility guaranteesstatic <InputT,
AccumT, OutputT>
StateSpec<CombiningState<InputT, AccumT, OutputT>> combiningFromInputInternal
(Coder<InputT> inputCoder, Combine.CombineFn<InputT, AccumT, OutputT> combineFn) For internal use only; no backwards-compatibility guarantees.convertToBagSpecInternal
(StateSpec<CombiningState<InputT, AccumT, OutputT>> combiningSpec) For internal use only; no backwards-compatibility guarantees.convertToMapSpecInternal
(StateSpec<SetState<KeyT>> setStateSpec) For internal use only; no backwards-compatibility guarantees.static <KeyT,
ValueT>
StateSpec<MultimapState<KeyT, ValueT>> convertToMultimapSpecInternal
(StateSpec<MapState<KeyT, ValueT>> spec) For internal use only; no backwards-compatibility guarantees.map()
Identical tomap()
, but with key and value coders explicitly supplied.static <K,
V> StateSpec <MultimapState<K, V>> multimap()
Create aStateSpec
for aMultimapState
, optimized for key lookups, key puts, and clear.static <K,
V> StateSpec <MultimapState<K, V>> Identical tomultimap()
, but with key and value coders explicitly supplied.static <T> StateSpec
<OrderedListState<T>> orderedList
(Coder<T> elemCoder) static StateSpec
<MultimapState<Row, Row>> rowMultimap
(Schema keySchema, Schema valueSchema) Create aStateSpec
for aMultimapState
, optimized for key lookups, key puts, and clear.static StateSpec
<OrderedListState<Row>> rowOrderedList
(Schema valueSchema) static StateSpec
<ValueState<Row>> Create aStateSpec
for a row value with the specified schema.set()
Identical toset()
, but with an element coder explicitly supplied.static <T> StateSpec
<ValueState<T>> value()
Create aStateSpec
for a single value of typeT
.static <T> StateSpec
<ValueState<T>> Identical tovalue()
, but with a coder explicitly supplied.static StateSpec
<WatermarkHoldState> watermarkStateInternal
(TimestampCombiner timestampCombiner) For internal use only; no backwards-compatibility guarantees.
-
Method Details
-
value
Create aStateSpec
for a single value of typeT
.This method attempts to infer the value coder automatically.
If the value type has a schema registered, then the schema will be used to encode the values.
- See Also:
-
rowValue
Create aStateSpec
for a row value with the specified schema. -
value
Identical tovalue()
, but with a coder explicitly supplied.If automatic coder inference fails, use this method.
-
combining
public static <InputT,AccumT, StateSpec<CombiningState<InputT,OutputT> AccumT, combiningOutputT>> (Combine.CombineFn<InputT, AccumT, OutputT> combineFn) Create aStateSpec
for aCombiningState
which uses aCombine.CombineFn
to automatically merge multiple values of typeInputT
into a single resultingOutputT
.This method attempts to infer the accumulator coder automatically.
- See Also:
-
combining
@Internal public static <InputT,AccumT, StateSpec<CombiningState<InputT,OutputT> AccumT, combiningOutputT>> (CombineWithContext.CombineFnWithContext<InputT, AccumT, OutputT> combineFn) For internal use only; no backwards compatibility guaranteesCreate a
StateSpec
for aCombiningState
which uses aCombineWithContext.CombineFnWithContext
to automatically merge multiple values of typeInputT
into a single resultingOutputT
.This method attempts to infer the accumulator coder automatically.
- See Also:
-
combining
public static <InputT,AccumT, StateSpec<CombiningState<InputT,OutputT> AccumT, combiningOutputT>> (Coder<AccumT> accumCoder, Combine.CombineFn<InputT, AccumT, OutputT> combineFn) Identical tocombining(CombineFn)
, but with an accumulator coder explicitly supplied.If automatic coder inference fails, use this method.
-
combining
@Internal public static <InputT,AccumT, StateSpec<CombiningState<InputT,OutputT> AccumT, combiningOutputT>> (Coder<AccumT> accumCoder, CombineWithContext.CombineFnWithContext<InputT, AccumT, OutputT> combineFn) For internal use only; no backwards compatibility guaranteesIdentical to
combining(CombineFnWithContext)
, but with an accumulator coder explicitly supplied.If automatic coder inference fails, use this method.
-
bag
Create aStateSpec
for aBagState
, optimized for adding values frequently and occasionally retrieving all the values that have been added.This method attempts to infer the element coder automatically.
If the element type has a schema registered, then the schema will be used to encode the values.
- See Also:
-
rowBag
-
bag
Identical tobag()
, but with an element coder explicitly supplied.If automatic coder inference fails, use this method.
-
set
Create aStateSpec
for aSetState
, optimized for checking membership.This method attempts to infer the element coder automatically.
If the element type has a schema registered, then the schema will be used to encode the values.
- See Also:
-
rowSet
-
set
Identical toset()
, but with an element coder explicitly supplied.If automatic coder inference fails, use this method.
-
map
Create aStateSpec
for aMapState
, optimized for key lookups and writes.This method attempts to infer the key and value coders automatically.
If the key and value types have schemas registered, then the schemas will be used to encode the elements.
- See Also:
-
rowMap
Create aStateSpec
for aMapState
, optimized for key lookups and writes.This method is for storing maps where both the keys and the values are rows with the specified schemas.
- See Also:
-
map
Identical tomap()
, but with key and value coders explicitly supplied.If automatic coder inference fails, use this method.
-
orderedList
-
rowOrderedList
-
multimap
Create aStateSpec
for aMultimapState
, optimized for key lookups, key puts, and clear.This method attempts to infer the key and value coders automatically.
If the key and value types have schemas registered, then the schemas will be used to encode the elements.
- See Also:
-
rowMultimap
Create aStateSpec
for aMultimapState
, optimized for key lookups, key puts, and clear.This method is for storing multimaps where both the keys and the values are rows with the specified schemas.
- See Also:
-
multimap
Identical tomultimap()
, but with key and value coders explicitly supplied.If automatic coder inference fails, use this method.
-
combiningFromInputInternal
@Internal public static <InputT,AccumT, StateSpec<CombiningState<InputT,OutputT> AccumT, combiningFromInputInternalOutputT>> (Coder<InputT> inputCoder, Combine.CombineFn<InputT, AccumT, OutputT> combineFn) For internal use only; no backwards-compatibility guarantees.Create a state spec for values that use a
Combine.CombineFn
to automatically merge multipleInputT
s into a singleOutputT
.This determines the
Coder<AccumT>
from the givenCoder<InputT>
, and should only be used to initialize static values. -
watermarkStateInternal
@Internal public static StateSpec<WatermarkHoldState> watermarkStateInternal(TimestampCombiner timestampCombiner) For internal use only; no backwards-compatibility guarantees.Create a state spec for a watermark hold.
-
convertToBagSpecInternal
@Internal public static <InputT,AccumT, StateSpec<BagState<AccumT>> convertToBagSpecInternalOutputT> (StateSpec<CombiningState<InputT, AccumT, OutputT>> combiningSpec) For internal use only; no backwards-compatibility guarantees.Convert a combining state spec to a bag of accumulators.
-
convertToMapSpecInternal
@Internal public static <KeyT> StateSpec<MapState<KeyT,Boolean>> convertToMapSpecInternal(StateSpec<SetState<KeyT>> setStateSpec) For internal use only; no backwards-compatibility guarantees.Convert a set state spec to a map-state spec.
-
convertToMultimapSpecInternal
@Internal public static <KeyT,ValueT> StateSpec<MultimapState<KeyT,ValueT>> convertToMultimapSpecInternal(StateSpec<MapState<KeyT, ValueT>> spec) For internal use only; no backwards-compatibility guarantees.Convert a set state spec to a map-state spec.
-