[ 
https://issues.apache.org/jira/browse/FLINK-4993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15633017#comment-15633017
 ] 

ASF GitHub Bot commented on FLINK-4993:
---------------------------------------

GitHub user aljoscha opened a pull request:

    https://github.com/apache/flink/pull/2751

    Window operator changes

    The changes are described in the commit message of each commit.
    
    ### [FLINK-4993] Don't Allow Trigger.onMerge() to return TriggerResult
    Allowing Trigger.onMerge() to return a TriggerResult is not necessary
    since an onMerge() call will always be followed by an onElement() call
    when adding the element that caused the merging to the merged window.
    Having this complicates the internal logic of the WindowOperator and
    makes writing Triggers more confusing than it has to be.
    
    ### [FLINK-4994] Don't Clear Trigger State and Merging Window Set When 
Purging
    
    Before, when a Trigger returns TriggerResult.PURGE from any of the
    on*() methods the WindowOperator will clear all state of that window
    (window contents, merging window set) and call Trigger.clear() so that the
    Trigger can clean up its state/timers.
    
    This was problematic in some cases. For example, with merging windows 
(session
    windows) this means that a late-arriving element will not be put into the
    session that was previously built up but will be put into a completely new
    session that only contains this one element.
    
    The new behaviour is this:
     * Only clean window contents on PURGE
     * Register cleanup timer for any window, don't delete this on PURGE
     * When the cleanup timer fires: clean window state, clean merging window 
set, call Trigger.clear() to allow it to clean state/timers
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aljoscha/flink window-operator-changes

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/2751.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 #2751
    
----
commit ebd515ff18b93429b3cba714b0413170748d035b
Author: Aljoscha Krettek <[email protected]>
Date:   2016-11-02T10:06:01Z

    [FLINK-4993] Don't Allow Trigger.onMerge() to return TriggerResult
    
    Allowing Trigger.onMerge() to return a TriggerResult is not necessary
    since an onMerge() call will always be followed by an onElement() call
    when adding the element that caused the merging to the merged window.
    Having this complicates the internal logic of the WindowOperator and
    makes writing Triggers more confusing than it has to be.

commit 1f9fd1fb1e9c8ef85e7782669e45f620e3dace31
Author: Aljoscha Krettek <[email protected]>
Date:   2016-11-02T10:51:07Z

    [FLINK-4994] Don't Clear Trigger State and Merging Window Set When Purging
    
    Before, when a Trigger returns TriggerResult.PURGE from any of the
    on*() methods the WindowOperator will clear all state of that window
    (window contents, merging window set) and call Trigger.clear() so that the
    Trigger can clean up its state/timers.
    
    This was problematic in some cases. For example, with merging windows 
(session
    windows) this means that a late-arriving element will not be put into the
    session that was previously built up but will be put into a completely new
    session that only contains this one element.
    
    The new behaviour is this:
     * Only clean window contents on PURGE
     * Register cleanup timer for any window, don't delete this on PURGE
     * When the cleanup timer fires: clean window state, clean merging window 
set,
    call Trigger.clear() to allow it to clean state/timers

----


> Don't Allow Trigger.onMerge() to return TriggerResult
> -----------------------------------------------------
>
>                 Key: FLINK-4993
>                 URL: https://issues.apache.org/jira/browse/FLINK-4993
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Streaming
>            Reporter: Aljoscha Krettek
>            Assignee: Aljoscha Krettek
>
> Allowing {{Trigger.onMerge()}} to return a {{TriggerResult}} is not necessary 
> since an {{onMerge()}} call will always be followed by an {{onElement()}} 
> call when adding the element that caused the merging to the merged window. 
> Having this complicates the internal logic of the {{WindowOperator}} and 
> makes writing Triggers more confusing than it has to be.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to