[
https://issues.apache.org/jira/browse/FLINK-3674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15355287#comment-15355287
]
Aljoscha Krettek commented on FLINK-3674:
-----------------------------------------
I think the way to properly address this is to implement a watermark timer
system that user functions can use. This would also handle the case of a
{{KeyedStream}} where timers are scoped to a key and the correct key scope is
set when a timer fires. Right now, {{WindowOperator}} has a custom
implementation of this. This should be taken as the basis for a generic
implementation than can then also be exposed to users.
> 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)