GitHub user aljoscha opened a pull request:
https://github.com/apache/flink/pull/1802
[FLINK-3174] Add MergingWindowAssigner and SessionWindows
This introduces MergingWindowAssigner, an extension of WindowAssigner
that can merge windows. When using a MergingWindowAssigner the
WindowOperator eagerly merges windows when processing elements.
For keeping track of in-flight windows and for merging windows this adds
MergingWindowSet, this keeps track of windows per key.
Only when using a WindowAssigners is the more costly merging logic used
in the WindowOperator.
For triggers there is new method Trigger.onMerge() that notifies the
trigger of the new merged window. This allows the trigger to set a timer
for the newly merged window.
This also adds AbstractStateBackend.mergePartitionedStates for merging
state of several source namespaces into a target namespace. This is only
possible for the newly introduced MergingState which is an extension of
AppendingState. Only ReducingState and ListState are MergingState while
FoldingState is now an AppendingState.
This enables proper support for session windows.
This also adds the SessionWindows window assigner and adapts an existing
session example and adds test cases.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aljoscha/flink window-sessions-eager
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1802.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1802
----
commit bda4e019cc464f411a2b62eaeab41a87f3961a21
Author: Aljoscha Krettek <[email protected]>
Date: 2015-12-15T16:37:48Z
[FLINK-3174] Add MergingWindowAssigner and SessionWindows
This introduces MergingWindowAssigner, an extension of WindowAssigner
that can merge windows. When using a MergingWindowAssigner the
WindowOperator eagerly merges windows when processing elements.
For keeping track of in-flight windows and for merging windows this adds
MergingWindowSet, this keeps track of windows per key.
Only when using a WindowAssigners is the more costly merging logic used
in the WindowOperator.
For triggers there is new method Trigger.onMerge() that notifies the
trigger of the new merged window. This allows the trigger to set a timer
for the newly merged window.
This also adds AbstractStateBackend.mergePartitionedStates for merging
state of several source namespaces into a target namespace. This is only
possible for the newly introduced MergingState which is an extension of
AppendingState. Only ReducingState and ListState are MergingState while
FoldingState is now an AppendingState.
This enables proper support for session windows.
This also adds the SessionWindows window assigner and adapts an existing
session example and adds test cases.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---