Package org.apache.beam.sdk.state
Interface GroupingState<InputT,OutputT>
- Type Parameters:
InputT- the type of values added to the stateOutputT- the type of value extracted from the state
- All Superinterfaces:
ReadableState<OutputT>,State
- All Known Subinterfaces:
BagState<T>,CombiningState<InputT,,AccumT, OutputT> OrderedListState<T>,SetState<T>,WatermarkHoldState
A
ReadableState cell that combines multiple input values and outputs a single value of a
different type.
This generalizes GroupByKey and Combine styles of grouping.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a value to the buffer.isEmpty()Returns aReadableStatewhoseReadableState.read()method will return true if this state is empty at the point when thatReadableState.read()call returns.Indicate that the value will be read later.Methods inherited from interface org.apache.beam.sdk.state.ReadableState
read
-
Method Details
-
add
Add a value to the buffer.Elements added will not be reflected in
OutputTobjects returned by previous calls toReadableState.read(). -
isEmpty
ReadableState<Boolean> isEmpty()Returns aReadableStatewhoseReadableState.read()method will return true if this state is empty at the point when thatReadableState.read()call returns. -
readLater
GroupingState<InputT,OutputT> readLater()Description copied from interface:ReadableStateIndicate that the value will be read later.This allows an implementation to start an asynchronous prefetch or to include this state in the next batch of reads.
- Specified by:
readLaterin interfaceReadableState<InputT>- Returns:
- this for convenient chaining
-