flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-3674) Add an interface for Time aware User Functions
Date Thu, 20 Oct 2016 10:34:58 GMT

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

ASF GitHub Bot commented on FLINK-3674:
---------------------------------------

Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2570#discussion_r84255151
  
    --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/DefaultProcessingTimeService.java
---
    @@ -35,10 +34,10 @@
     import static org.apache.flink.util.Preconditions.checkNotNull;
     
     /**
    - * A {@link TimeServiceProvider} which assigns as current processing time the result
of calling
    + * A {@link ProcessingTimeService} which assigns as current processing time the result
of calling
      * {@link System#currentTimeMillis()} and registers timers using a {@link ScheduledThreadPoolExecutor}.
      */
    -public class DefaultTimeServiceProvider extends TimeServiceProvider {
    +public class DefaultProcessingTimeService extends ProcessingTimeService {
     
    --- End diff --
    
    Done


> Add an interface for Time aware User Functions
> ----------------------------------------------
>
>                 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: Aljoscha Krettek
>
> 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