Hello all,

I just realized that in the windowing implementation, we use an
additional thread as a timer for processing time triggered windows:

https://github.com/apache/storm/blob/master/storm-client/src/jvm/org/apache/storm/windowing/TimeTriggerPolicy.java#L71

We also do the same thing in:

https://github.com/apache/storm/blob/master/storm-client/src/jvm/org/apache/storm/windowing/WaterMarkEventGenerator.java#L71

to periodically generate watermarks.

Perhaps, instead of additional threads we can just use tick tuples for
such triggering of events?  Or we can allow registration of timers and
callback functions in topologies so that additional timer threads
would be not be needed?  I know that the tick tuple frequency is in
seconds and windowing supports millisecond granularity but the tick
tuple frequency can easily be changed to support millisecond
frequency.

On the other hand, a more eloquent solution would be having an API
that allows users to register arbitrary timer events in their
topologies. Something like this:

conf.registerTimer(long frequency, Object callback)

Anyone have any thoughts on this?

Best,

Jerry

Reply via email to