[ https://issues.apache.org/jira/browse/FLINK-3674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15395403#comment-15395403 ]
ASF GitHub Bot commented on FLINK-3674: --------------------------------------- Github user ramkrish86 commented on the issue: https://github.com/apache/flink/pull/2301 Created two interfaces EventTimeFunction and a WindowTimer (interface). The WindowTimer interface allows users to implement their own watermark timers and the way they could be fired. The EventTimeFunction could be used with any user defined functions and allows the creation of the WindowTimer. So the WindowOperator will see if the UDF is EventTimeFunction and uses the WindowTimer created by the EventimeFunction. If not it will use the DefaultTimer as in the current case. I ran mvn verify to ensure there are no checkstyle or compilation errors. @aljoscha Any feedback/ suggestions? This will now allow users to customize the timers. > 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 > Assignee: ramkrishna.s.vasudevan > > 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)