Hi Anchit, I think you need a customized EventTimeTrigger <https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/triggers/EventTimeTrigger.java#L43> which returns "TriggerResult.FIRE" both on new element and watermark.
Thanks, Manu Zhang On Fri, Oct 21, 2016 at 3:08 PM Anchit Jatana <development.anc...@gmail.com> wrote: > Hi All, > > I have a use case where in I'm supposed to work with Session Windows to > maintain some values for some sessionIDs/keys. > > The use case is as follows: > > I need to maintain a session window for the incoming data and discard the > window after some set gap/period of inactivity but what I want is that as > soon as new element gets added to the window, all the records that are > currently in the window get processed using the window > transformation/function and the window does not get discarded. > > The "Session windows implementation" as get processed only after the > window is consider complete(based on some gap time settings). But I wish to > process the all the elements contained in the window as soon as a new > element gets added to the window(means addition of a new element triggers > the processing of all elements of the window) but the discarding of the > window happens only if there is a gap/inactivity for some set time. And > when the window gets discarded/expires I don't want it to be re-evaluated, > since it's contents were processed when the last element was added to the > window. > > Is this implementation possible? If yes, can someone please share some > sample code to explain the implementation. > > Thank you! > > Regards, > Anchit >