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 TypeMethodDescriptionvoid
Add a value to the buffer.isEmpty()
Returns aReadableState
whoseReadableState.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
OutputT
objects returned by previous calls toReadableState.read()
. -
isEmpty
ReadableState<Boolean> isEmpty()Returns aReadableState
whoseReadableState.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:ReadableState
Indicate 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:
readLater
in interfaceReadableState<InputT>
- Returns:
- this for convenient chaining
-