You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Stephan Ewen (JIRA)" <ji...@apache.org> on 2016/03/29 12:12:25 UTC

[jira] [Created] (FLINK-3674) Add an interface for EventTime aware User Function

Stephan Ewen created FLINK-3674:
-----------------------------------

             Summary: 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
             Fix For: 1.1.0


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)