public abstract class WindowsGrouping extends Object implements Closeable
Assign windows and trigger aggregate calculation based on WindowsGrouping.
It can avoid data expansion in time sliding window case.
Tumbling window case
Each keyed window corresponds to only one element in the WindowsGrouping Buffer
(grouping keys, assigned windows, agg buffers).
Sliding window case
1. If the assign pane optimization strategy is used, each keyed window corresponding to
WindowsGrouping buffer contains windowsSize/paneSize number of elements
(assuming 1s/24h window, there are 86400 elements).
2. Otherwise, the maximum number of elements in WindowsGrouping buffer is the maximum
number of inputs in a sliding window.
In most cases, assign pane optimization should be applied, so there should not be much data
in WindowsGrouping, and HeapWindowsGrouping is basically okay.
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addInputToBuffer(org.apache.flink.table.data.binary.BinaryRowData input) |
protected abstract void |
addIntoBuffer(org.apache.flink.table.data.binary.BinaryRowData input) |
void |
advanceWatermarkToTriggerAllWindows()
Advance the watermark to trigger all the possible windows.
|
RowIterator<org.apache.flink.table.data.binary.BinaryRowData> |
buildTriggerWindowElementsIterator() |
TimeWindow |
getTriggerWindow() |
boolean |
hasTriggerWindow()
Check if there are windows could be triggered according to the current watermark.
|
protected abstract RowIterator<org.apache.flink.table.data.binary.BinaryRowData> |
newBufferIterator(int startIndex) |
protected abstract void |
onBufferEvict(int limitIndex) |
void |
reset()
Reset for next group.
|
protected abstract void |
resetBuffer() |
public void reset()
public void addInputToBuffer(org.apache.flink.table.data.binary.BinaryRowData input)
throws IOException
IOExceptionpublic void advanceWatermarkToTriggerAllWindows()
public boolean hasTriggerWindow()
public RowIterator<org.apache.flink.table.data.binary.BinaryRowData> buildTriggerWindowElementsIterator()
public TimeWindow getTriggerWindow()
protected abstract void resetBuffer()
protected abstract void addIntoBuffer(org.apache.flink.table.data.binary.BinaryRowData input)
throws IOException
IOExceptionprotected abstract void onBufferEvict(int limitIndex)
protected abstract RowIterator<org.apache.flink.table.data.binary.BinaryRowData> newBufferIterator(int startIndex)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.