flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ramkrishna.s.vasudevan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-3674) Add an interface for EventTime aware User Function
Date Sun, 03 Jul 2016 11:37:10 GMT

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

ramkrishna.s.vasudevan commented on FLINK-3674:
-----------------------------------------------

[~aljoscha]
I read thro the code in WindowOperator and how the customized Timer is used. The timer is
used when there is registration of event needs to happen. So this creates waterMarkTimer and
processingTimers. Every timer is associated with a timewindow which depends on either SlidingTime
or Tumbling type.
So by introducing an interface for the Timer - we allow users to implement the way the timer
comparison has to happen ? The Time r interface will have something like onWaterMark(WaterMark)
and that will be called when userFunction.apply is called with a Fire happens?  
The impl in WindowOperator will become the default impl of the Timer interface?

> Add an interface for EventTime aware User Function
> --------------------------------------------------
>
>                 Key: FLINK-3674
>                 URL: https://issues.apache.org/jira/browse/FLINK-3674
>             Project: Flink
>          Issue Type: New Feature
>          Components: Streaming
>    Affects Versions: 1.0.0
>            Reporter: Stephan Ewen
>
> I suggest to add an interface that UDFs can implement, which will let them be notified
upon watermark updates.
> Example usage:
> {code}
> public interface EventTimeFunction {
>     void onWatermark(Watermark watermark);
> }
> public class MyMapper implements MapFunction<String, String>, EventTimeFunction
{
>     private long currentEventTime = Long.MIN_VALUE;
>     public String map(String value) {
>         return value + " @ " + currentEventTime;
>     }
>     public void onWatermark(Watermark watermark) {
>         currentEventTime = watermark.getTimestamp();
>     }
> }
> {code}



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

Mime
View raw message