W
- The type of Window
that assigner assigns.public class MergingWindowProcessFunction<K,W extends Window> extends InternalWindowProcessFunction<K,W>
InternalWindowProcessFunction
for MergingWindowAssigner
.Modifier and Type | Class and Description |
---|---|
static class |
MergingWindowProcessFunction.DefaultAccMergingConsumer<W extends Window>
A default merging consumer that merges the accumulators in state windows that waiting to be
merged into the target state window.
|
static interface |
MergingWindowProcessFunction.MergingContext<K,W extends Window>
A
Context used for MergingWindowProcessFunction . |
InternalWindowProcessFunction.Context<K,W extends Window>
allowedLateness, ctx, windowAggregator
Constructor and Description |
---|
MergingWindowProcessFunction(MergingWindowAssigner<W> windowAssigner,
NamespaceAggsHandleFunctionBase<W> windowAggregator,
TypeSerializer<W> windowSerializer,
long allowedLateness) |
Modifier and Type | Method and Description |
---|---|
Collection<W> |
assignActualWindows(RowData inputRow,
long timestamp)
Assigns the input element into the actual windows which the
Trigger should trigger
on. |
Collection<W> |
assignStateNamespace(RowData inputRow,
long timestamp)
Assigns the input element into the state namespace which the input element should be
accumulated/retracted into.
|
void |
cleanWindowIfNeeded(W window,
long currentTime)
Cleans the given window if needed.
|
W |
getStateWindow(W window)
Get the state window as the namespace stored acc in the data about this actual window.
|
void |
open(InternalWindowProcessFunction.Context<K,W> ctx)
Initialization method for the function.
|
void |
prepareAggregateAccumulatorForEmit(W window)
Prepares the accumulator of the given window before emit the final result.
|
close, isCleanupTime, isWindowLate
public MergingWindowProcessFunction(MergingWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, TypeSerializer<W> windowSerializer, long allowedLateness)
public void open(InternalWindowProcessFunction.Context<K,W> ctx) throws Exception
InternalWindowProcessFunction
public Collection<W> assignStateNamespace(RowData inputRow, long timestamp) throws Exception
InternalWindowProcessFunction
assignStateNamespace
in class InternalWindowProcessFunction<K,W extends Window>
inputRow
- the input elementtimestamp
- the timestamp of the element or the processing time (depends on the type of
assigner)Exception
public Collection<W> assignActualWindows(RowData inputRow, long timestamp) throws Exception
InternalWindowProcessFunction
Trigger
should trigger
on.assignActualWindows
in class InternalWindowProcessFunction<K,W extends Window>
inputRow
- the input elementtimestamp
- the timestamp of the element or the processing time (depends on the type of
assigner)Exception
public void prepareAggregateAccumulatorForEmit(W window) throws Exception
InternalWindowProcessFunction
prepareAggregateAccumulatorForEmit
in class InternalWindowProcessFunction<K,W extends Window>
window
- the windowException
public void cleanWindowIfNeeded(W window, long currentTime) throws Exception
InternalWindowProcessFunction
cleanWindowIfNeeded
in class InternalWindowProcessFunction<K,W extends Window>
window
- the window to cleanupcurrentTime
- the current timestampException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.