Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-3674

Add an interface for Time aware User Functions

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.2.0
    • API / DataStream
    • None

    Description

      I suggest to add an interface that UDFs can implement, which will let them be notified upon watermark updates.

      Example usage:

      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();
          }
      }
      

      Attachments

        Activity

          People

            aljoscha Aljoscha Krettek
            sewen Stephan Ewen
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: