You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jamie Grier (JIRA)" <ji...@apache.org> on 2016/11/04 14:05:58 UTC
[jira] [Comment Edited] (FLINK-5012) Provide Timestamp in
TimelyFlatMapFunction
[ https://issues.apache.org/jira/browse/FLINK-5012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15636428#comment-15636428 ]
Jamie Grier edited comment on FLINK-5012 at 11/4/16 2:05 PM:
-------------------------------------------------------------
Okay, makes sense about RuntimeContext.. I also like your "ideal" solution best -- or maybe:
{code:java}
void flatMap(I value, Context ctx) throws Exception;
interface Context {
Long timestamp();
TimerService timerService();
Collector<OUT> collector();
}
{code}
Maybe the above is "close enough" to what people are used to since it still uses the Collector interface.
was (Author: jgrier):
Okay, makes sense about RuntimeContext.. I also like your "ideal" solution best -- or maybe:
{code:java}
void flatMap(I value, Context ctx) throws Exception;
interface Context {
Long timestamp();
TimerService timerService();
Collector<OUT> collector();
}
{code}
> Provide Timestamp in TimelyFlatMapFunction
> ------------------------------------------
>
> Key: FLINK-5012
> URL: https://issues.apache.org/jira/browse/FLINK-5012
> Project: Flink
> Issue Type: Improvement
> Components: Streaming
> Reporter: Aljoscha Krettek
>
> Right now, {{TimelyFlatMapFunction}} does not give the timestamp of the element in {{flatMap()}}.
> The signature is currently this:
> {code}
> void flatMap(I value, TimerService timerService, Collector<O> out) throws Exception;
> {code}
> if we add the timestamp it would become this:
> {code}
> void flatMap(I value, Long timestamp, TimerService timerService, Collector<O> out) throws Exception;
> {code}
> The reason why it's a {{Long}} and not a {{long}} is that an element might not have a timestamp, in that case we should hand in {{null}} here.
> This is becoming quite look so we could add a {{Context}} parameter that provides access to the timestamp and timer service.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)