Hi, the timers are scoped to the current key when you apply a processing function to a KeyedStream. If you register more than one timer for a particular key and timestamp, you will get only one onTimer callback, see also in docs [1]. Timers registered in a processing function will trigger only in this processing function. All records and timer callbacks are processed sequentially for a particular key in one of parallel instances of the operator.
Depending on your use case, if you use event time timer, it might make sense to use current watermark as a ‘currentTime’ in your code snippet. Best, Andrey [1] https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/stream/operators/process_function.html#timers <https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/stream/operators/process_function.html#timers> > On 31 Aug 2018, at 13:42, Boris Lublinsky <[email protected]> > wrote: > > I am effectively trying to simulate processing windows - drop the results > that are not complete in time and was trying to use onTimer method in my > Processor implementation. > I am not sure that I understand exactly how this works. When I start > execution (in a different processor) I am executing > ctx.timerService.registerEventTimeTimer(currentTime + > speculativeTimeout.value()) > Basically the absolute cut off time. > > Is this the right usage? What is happening when I have more then on timer > started? > > > Boris Lublinsky > FDP Architect > [email protected] <mailto:[email protected]> > https://www.lightbend.com/ >
