W
- type of windowpublic abstract class InternalWindowProcessFunction<K,W extends Window> extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
InternalWindowProcessFunction.Context<K,W extends Window>
Information available in an invocation of methods of
InternalWindowProcessFunction . |
Modifier and Type | Field and Description |
---|---|
protected long |
allowedLateness |
protected InternalWindowProcessFunction.Context<K,W> |
ctx |
protected NamespaceAggsHandleFunctionBase<W> |
windowAggregator |
protected GroupWindowAssigner<W> |
windowAssigner |
Modifier | Constructor and Description |
---|---|
protected |
InternalWindowProcessFunction(GroupWindowAssigner<W> windowAssigner,
NamespaceAggsHandleFunctionBase<W> windowAggregator,
long allowedLateness) |
Modifier and Type | Method and Description |
---|---|
abstract Collection<W> |
assignActualWindows(RowData inputRow,
long timestamp)
Assigns the input element into the actual windows which the
Trigger should trigger
on. |
abstract Collection<W> |
assignStateNamespace(RowData inputRow,
long timestamp)
Assigns the input element into the state namespace which the input element should be
accumulated/retracted into.
|
abstract void |
cleanWindowIfNeeded(W window,
long currentTime)
Cleans the given window if needed.
|
void |
close()
The tear-down method of the function.
|
protected boolean |
isCleanupTime(W window,
long time)
Returns
true if the given time is the cleanup time for the given window. |
protected boolean |
isWindowLate(W window)
Returns
true if the watermark is after the end timestamp plus the allowed lateness of
the given window. |
void |
open(InternalWindowProcessFunction.Context<K,W> ctx)
Initialization method for the function.
|
abstract void |
prepareAggregateAccumulatorForEmit(W window)
Prepares the accumulator of the given window before emit the final result.
|
protected final GroupWindowAssigner<W extends Window> windowAssigner
protected final NamespaceAggsHandleFunctionBase<W extends Window> windowAggregator
protected final long allowedLateness
protected InternalWindowProcessFunction.Context<K,W extends Window> ctx
protected InternalWindowProcessFunction(GroupWindowAssigner<W> windowAssigner, NamespaceAggsHandleFunctionBase<W> windowAggregator, long allowedLateness)
public void open(InternalWindowProcessFunction.Context<K,W> ctx) throws Exception
Exception
public abstract Collection<W> assignStateNamespace(RowData inputRow, long timestamp) throws Exception
inputRow
- the input elementtimestamp
- the timestamp of the element or the processing time (depends on the type of
assigner)Exception
public abstract Collection<W> assignActualWindows(RowData inputRow, long timestamp) throws Exception
Trigger
should trigger
on.inputRow
- the input elementtimestamp
- the timestamp of the element or the processing time (depends on the type of
assigner)Exception
public abstract void prepareAggregateAccumulatorForEmit(W window) throws Exception
window
- the windowException
public abstract void cleanWindowIfNeeded(W window, long currentTime) throws Exception
window
- the window to cleanupcurrentTime
- the current timestampException
public void close() throws Exception
Exception
protected final boolean isCleanupTime(W window, long time)
true
if the given time is the cleanup time for the given window.protected boolean isWindowLate(W window)
true
if the watermark is after the end timestamp plus the allowed lateness of
the given window.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.