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
@Experimental(STATE) public interface GroupingState<InputT,OutputT> extends ReadableState<OutputT>, State
AReadableState
cell that combines multiple input values and outputs a single value of a different type.This generalizes
GroupByKey
andCombine
styles of grouping.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(InputT value)
Add a value to the buffer.ReadableState<java.lang.Boolean>
isEmpty()
Returns aReadableState
whoseReadableState.read()
method will return true if this state is empty at the point when thatReadableState.read()
call returns.GroupingState<InputT,OutputT>
readLater()
Indicate that the value will be read later.-
Methods inherited from interface org.apache.beam.sdk.state.ReadableState
read
-
-
-
-
Method Detail
-
add
void add(InputT value)
Add a value to the buffer.Elements added will not be reflected in
OutputT
objects returned by previous calls toReadableState.read()
.
-
isEmpty
ReadableState<java.lang.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
-
-