flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kostas Kloudas <k.klou...@data-artisans.com>
Subject Re: Regarding Late Elements
Date Tue, 04 Oct 2016 16:28:50 GMT
Hi Vinay,

These methods are useful when using your trigger with SessionWindows. When using session windows,

the state of a window and that of the corresponding trigger has to be merged with that of
other windows. 

These methods do exactly that: the canMerge() says if the trigger can be used with Session
Windows, and if yes,
the onMerge() includes the logic of what to do with the trigger state when a window merging

As an example you can check out the CountTrigger.

I hope this answers your question.


> On Oct 4, 2016, at 6:10 PM, vinay patil <vinay18.patil@gmail.com> wrote:
> Hi Kostas,
> Yes you are right , I am always doing  FIRE_AND_PURGE , if we don't do this and only
use FIRE , the window function will get the elements in incremental fashion (1, 2,3..so on)
> I had observed this while testing.
> Can you please explain me the importance of canMerge and onMerge functions in trigger,
from the javadocs I got it on a high level, but not able to understand it correctly (so I
am not using these functions for now in Custom Trigger).
> Regards,
> Vinay Patil
> On Tue, Oct 4, 2016 at 10:51 AM, Kostas Kloudas [via Apache Flink User Mailing List archive.]
<[hidden email] <x-msg://14/user/SendEmail.jtp?type=node&node=9331&i=0>>
> Hi Vinay,
> By setting the allowed_lateness to LongMax you are ok. 
> Sorry I forgot that this was the default value. 
> Just a note (although you have it right in your code), in this case 
> you should always FIRE_AND_PURGE and not just FIRE. In other 
> case your state will keep growing as it is never garbage collected.
> Cheers,
> Kostas
>> On Oct 4, 2016, at 5:42 PM, vinay patil <[hidden email] <http://user/SendEmail.jtp?type=node&node=9329&i=0>>
> If you reply to this email, your message will be added to the discussion below:
> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Regarding-Late-Elements-tp9284p9329.html
> To start a new topic under Apache Flink User Mailing List archive., email [hidden email]
> To unsubscribe from Apache Flink User Mailing List archive., click here <applewebdata://6844F060-0841-49DA-811F-B7AE5E851424>.
> NAML <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> View this message in context: Re: Regarding Late Elements <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Regarding-Late-Elements-tp9284p9331.html>
> Sent from the Apache Flink User Mailing List archive. mailing list archive <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/>
at Nabble.com.

View raw message