Re: TimelyFlatMapFunction and DataStream
Posted by
Ken Krugler on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/TimelyFlatMapFunction-and-DataStream-tp9820p9836.html
Hi Stephan,
Hi Ken!
It may not be obvious, so here is a bit of background:
The timers that are used in the FlatMapFunction are scoped by key. We thought that this is how they are mainly useful - that's why you need to define keys to use them.
I think the docs are in error, thanks for pointing that out.
In your use case, do you need timers without keys, or only access to the current processing/event time?
I was hoping to use timers as an alternative approach for async generation of tuples. I’ve got several functions that use multi-threading to process the incoming tuples. These get put into a queue, processed by threads, and the results placed in another queue. With timers it seemed like I could regularly flush the output queue to the collector.
So unkeyed data, yes.
Though it wasn’t clear from the docs if/how I would set up a timer that regularly fires (say every 100ms).
In any case I can keep using my current approach of having a “tickler” Tuple0 stream that I use with CoFlatMapFunctions.
Regards,
— Ken
--------------------------
Ken Krugler
+1 530-210-6378
custom big data solutions & training
Hadoop, Cascading, Cassandra & Solr