K - The type of key being processed.InputT - The type of values associated with the key.OutputT - The output type that will be produced for each key.W - The type of windows this operates on.public class ReduceFnRunner<K,InputT,OutputT,W extends BoundedWindow> extends Object implements ActiveWindowSet.MergeCallback<W>
ReduceFn after a GroupByKey.GroupByKeyOnly has partitioned the
PCollection by key.
The onTrigger(com.google.cloud.dataflow.sdk.util.ReduceFn<K, InputT, OutputT, W>.Context, boolean, boolean) relies on a TriggerRunner to manage the execution of
the triggering logic. The ReduceFnRunners responsibilities are:
ReduceFn based on trigger execution, timer
firings, etc.
| Modifier and Type | Field and Description |
|---|---|
static String |
DROPPED_DUE_TO_CLOSED_WINDOW_COUNTER |
static String |
DROPPED_DUE_TO_LATENESS_COUNTER |
| Constructor and Description |
|---|
ReduceFnRunner(K key,
WindowingStrategy<?,W> windowingStrategy,
TimerInternals timerInternals,
WindowingInternals<?,KV<K,OutputT>> windowingInternals,
Aggregator<Long,Long> droppedDueToClosedWindow,
Aggregator<Long,Long> droppedDueToLateness,
ReduceFn<K,InputT,OutputT,W> reduceFn) |
| Modifier and Type | Method and Description |
|---|---|
void |
onMerge(Collection<W> mergedWindows,
W resultWindow,
boolean isResultWindowNew)
Called when windows merge.
|
void |
onTimer(TimerInternals.TimerData timer)
Called when a timer fires.
|
void |
persist()
Make sure that all the state built up in this runner has been persisted.
|
void |
processElement(WindowedValue<InputT> value) |
static <T> StateContents<T> |
stateContentsOf(T value) |
public static final String DROPPED_DUE_TO_CLOSED_WINDOW_COUNTER
public static final String DROPPED_DUE_TO_LATENESS_COUNTER
public ReduceFnRunner(K key, WindowingStrategy<?,W> windowingStrategy, TimerInternals timerInternals, WindowingInternals<?,KV<K,OutputT>> windowingInternals, Aggregator<Long,Long> droppedDueToClosedWindow, Aggregator<Long,Long> droppedDueToLateness, ReduceFn<K,InputT,OutputT,W> reduceFn)
public void processElement(WindowedValue<InputT> value)
public void persist()
public void onMerge(Collection<W> mergedWindows, W resultWindow, boolean isResultWindowNew)
onMerge in interface ActiveWindowSet.MergeCallback<W extends BoundedWindow>public void onTimer(TimerInternals.TimerData timer)
public static <T> StateContents<T> stateContentsOf(T value)