flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-8560) add KeyedProcessFunction to expose the key in onTimer() and other methods
Date Mon, 05 Mar 2018 10:00:08 GMT

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

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

Github user kl0u commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5481#discussion_r172136142
  
    --- Diff: docs/dev/stream/operators/process_function.md ---
    @@ -242,4 +242,17 @@ class CountWithTimeoutFunction extends ProcessFunction[(String, String),
(String
     the current processing time as event-time timestamp. This behavior is very subtle and
might not be noticed by users. Well, it's
     harmful because processing-time timestamps are indeterministic and not aligned with watermarks.
Besides, user-implemented logic
     depends on this wrong timestamp highly likely is unintendedly faulty. So we've decided
to fix it. Upon upgrading to 1.4.0, Flink jobs
    -that are using this incorrect event-time timestamp will fail, and users should adapt
their jobs to the correct logic.
    \ No newline at end of file
    +that are using this incorrect event-time timestamp will fail, and users should adapt
their jobs to the correct logic.
    +
    +## The KeyedProcessFunction
    +
    +`KeyedProcessFunction`, as an extension of `ProcessFunction`, gives access to the key
of timers in its `onTimer(...)`
    +method.
    +
    +{% highlight java %}
    --- End diff --
    
    @bowenli86 As soon as the scala example is added, I can take care of the other two comments
and merge! Let me know when you update the PR, and thanks for the work!


> add KeyedProcessFunction to expose the key in onTimer() and other methods
> -------------------------------------------------------------------------
>
>                 Key: FLINK-8560
>                 URL: https://issues.apache.org/jira/browse/FLINK-8560
>             Project: Flink
>          Issue Type: Improvement
>          Components: DataStream API
>    Affects Versions: 1.4.0
>            Reporter: J├╝rgen Thomann
>            Assignee: Bowen Li
>            Priority: Major
>             Fix For: 1.5.0
>
>
> Currently it is required to store the key of a keyBy() in the processElement method to
have access to it in the OnTimerContext.
> This is not so good as you have to check in the processElement method for every element
if the key is already stored and set it if it's not already set.
> A possible solution would adding OnTimerContext#getCurrentKey() or a similar method.
Maybe having it in the open() method could maybe work as well.
> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Getting-Key-from-keyBy-in-ProcessFunction-tt18126.html



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message