New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-3174] Add merging WindowAssigner #1460

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@aljoscha
Contributor

aljoscha commented Dec 16, 2015

After triggering and before emitting the window contents the window
assigner is given the change to merge existing windows. The trigger is
then given a chance to react in the new Trigger.onMerge() call.

This adds new method WindowAssigner.isMerging() that allows window
assigners to specify whether they can merge windows. All existing
assigners are now derived from NonMergingWindowAssigner that returns
false for isMerging(). Only of a WindowAssigners announces that it can
merge 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 as well as the old windows and old
trigger contexts. This allows the trigger to set a timer for the newly
merged window.

This enables proper support for session windows.

This also adds the SessionWindows window assigner and adapts an existing
session example and adds test cases.

[FLINK-3174] Add merging WindowAssigner
After triggering and before emitting the window contents the window
assigner is given the change to merge existing windows. The trigger is
then given a chance to react in the new Trigger.onMerge() call.

This adds new method WindowAssigner.isMerging() that allows window
assigners to specify whether they can merge windows. All existing
assigners are now derived from NonMergingWindowAssigner that returns
false for isMerging(). Only of a WindowAssigners announces that it can
merge 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 as well as the old windows and old
trigger contexts. This allows the trigger to set a timer for the newly
merged window.

This enables proper support for session windows.

This also adds the SessionWindows window assigner and adapts an existing
session example and adds test cases.
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
private static class Tuple3ResultSortComparator implements Comparator<Object> {

This comment has been minimized.

@rmetzger

rmetzger Jan 7, 2016

Contributor

duplicate code with NonKeyedWindowOperatorTest ?

@rmetzger

rmetzger Jan 7, 2016

Contributor

duplicate code with NonKeyedWindowOperatorTest ?

@@ -438,7 +617,7 @@ public void close() throws Exception {
}
@SuppressWarnings("unchecked")
private static class ResultSortComparator implements Comparator<Object> {
private static class Tuple2ResultSortComparator implements Comparator<Object> {

This comment has been minimized.

@rmetzger

rmetzger Jan 7, 2016

Contributor

this is also a duplicate with NonKeyedWindowOperatorTest according to IntelliJ

@rmetzger

rmetzger Jan 7, 2016

Contributor

this is also a duplicate with NonKeyedWindowOperatorTest according to IntelliJ

@rmetzger

This comment has been minimized.

Show comment
Hide comment
@rmetzger

rmetzger Jan 7, 2016

Contributor

Thank you for working on this! Session windows are something many people asked for!

Contributor

rmetzger commented Jan 7, 2016

Thank you for working on this! Session windows are something many people asked for!

@aljoscha

This comment has been minimized.

Show comment
Hide comment
@aljoscha

aljoscha Feb 22, 2016

Contributor

This will have to be reworked now that windows use the keyed state abstraction.

Contributor

aljoscha commented Feb 22, 2016

This will have to be reworked now that windows use the keyed state abstraction.

@aljoscha aljoscha closed this Feb 22, 2016

@aljoscha aljoscha deleted the aljoscha:window-sessions branch Mar 16, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment