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 NamespaceAggsHandleFunction<W> |
windowAggregator |
protected WindowAssigner<W> |
windowAssigner |
| Modifier | Constructor and Description |
|---|---|
protected |
InternalWindowProcessFunction(WindowAssigner<W> windowAssigner,
NamespaceAggsHandleFunction<W> windowAggregator,
long allowedLateness) |
| Modifier and Type | Method and Description |
|---|---|
abstract Collection<W> |
assignActualWindows(BaseRow inputRow,
long timestamp)
Assigns the input element into the actual windows which the
Trigger should trigger
on. |
abstract Collection<W> |
assignStateNamespace(BaseRow 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.
|
abstract BaseRow |
getWindowAggregationResult(W window)
Gets the aggregation result and window properties of the given window.
|
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.
|
protected final WindowAssigner<W extends Window> windowAssigner
protected final NamespaceAggsHandleFunction<W extends Window> windowAggregator
protected final long allowedLateness
protected InternalWindowProcessFunction.Context<K,W extends Window> ctx
protected InternalWindowProcessFunction(WindowAssigner<W> windowAssigner, NamespaceAggsHandleFunction<W> windowAggregator, long allowedLateness)
public void open(InternalWindowProcessFunction.Context<K,W> ctx) throws Exception
Exceptionpublic abstract Collection<W> assignStateNamespace(BaseRow inputRow, long timestamp) throws Exception
inputRow - the input elementtimestamp - the timestamp of the element or the processing time (depends on the type of
assigner)Exceptionpublic abstract Collection<W> assignActualWindows(BaseRow 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)Exceptionpublic abstract BaseRow getWindowAggregationResult(W window) throws Exception
window - the windowExceptionpublic abstract void cleanWindowIfNeeded(W window, long currentTime) throws Exception
window - the window to cleanupcurrentTime - the current timestampExceptionpublic void close()
throws Exception
Exceptionprotected 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–2020 The Apache Software Foundation. All rights reserved.