Hi all, I want to implement a custom Trigger which fired a GlobalWindow in 1 minute for the first time and every 20 seconds after that. I believe I cannot get this logic right in the implementation of my custom Trigger. Please help me with this. Here is the code of my custom Trigger:
|
Hi Piyush,
In the onElement function, you register a timer every time you receive an element. When the next watermark arrives, in the flag==false case, this will lead to every element adding a timer for its timestamp+60000ms. The same for flag==true case, with 20000ms interval. What you can try is to set only once, at the first element the initial trigger for 60 sec, and then just set all the rest in the on the onEventTime with 20 sec. To have a look at a custom trigger you can look at here: I hope this helped. Let me know if you need any help. Kostas
|
Hi, and delete the pending timers. Kostas
|
Thanks a lot Kostas. This solved my problem. On Monday, 25 April 2016 3:27 PM, Kostas Kloudas <[hidden email]> wrote: Hi, and delete the pending timers. Kostas
Hi Piyush, In the onElement function, you register a timer every time you receive an element. When the next watermark arrives, in the flag==false case, this will lead to every element adding a timer for its timestamp+60000ms. The same for flag==true case, with 20000ms interval. What you can try is to set only once, at the first element the initial trigger for 60 sec, and then just set all the rest in the on the onEventTime with 20 sec. To have a look at a custom trigger you can look at here: I hope this helped. Let me know if you need any help. Kostas
|
Good to hear that!
Kostas
|
Free forum by Nabble | Edit this page |