Hi, Ok, then I misunderstood. Yes, a PurgingTrigger it similar (the same) to always returning FIRE_AND_PURGE instead of FIRE in a custom Trigger. I thought your problem was that data is never cleared away when using GlobalWindows. Is that not the case?
Best, Aljoscha > On 14. Jul 2017, at 16:29, jad mad <jadmad0...@gmail.com> wrote: > > Hi Aljoscha > > thanks for the comment. > is wrapping by a PurgingTrigger.of() the same as doing "return > TriggerResult.FIRE_AND_PURGE;" > inside of a custom trigger? > > gave it a test and the result seems the opposite of what I meant... > instead of throwing away previous windows' contents, I wanna keep them > all the way till the end. > that way I can get the cumulative counts of all input. > > wonder how to achieve it. > anyone? > > jad > > > On Fri, Jul 14, 2017 at 12:16 AM, Aljoscha Krettek <aljos...@apache.org > <mailto:aljos...@apache.org>> wrote: > Window contents are only purged from state if the Trigger says so or if the > watermark passes the garbage collection horizon for a given window. With > GlobalWindows, the GC horizon is never reached, that leaves Triggers. > > You can create a Trigger that purges every time it fires by wrapping it in a > PurgingTrigger, i.e. > > .window(PurgingTrigger.of(<my trigger>)) > > Best, > Aljoscha > >> On 13. Jul 2017, at 14:00, jad mad <jadmad0...@gmail.com >> <mailto:jadmad0...@gmail.com>> wrote: >> >> Hi Prashant, >> >> env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime); >> >> actually I could make my custom trigger to fire periodically. >> The problem is the element set stored in the iterable variable >> is always uniform which is not what I'm expecting... >> >> private static class MyWindowFunction_Window... >> ... >> @Override >> public void apply(Tuple tuple, W window, Iterable<MyClass> iterable, >> ... >> for(MyClass element : iterable) >> >> does anyone have any idea on this? >> thanks a lot in advance, >> jad >> >> >> On Thu, Jul 13, 2017 at 10:55 AM, prashantnayak >> <prash...@intellifylearning.com <mailto:prash...@intellifylearning.com>> >> wrote: >> Hi >> >> We've have custom operators using global windows and are using event time. >> >> How are you specifying event time as the time characteristic? >> >> Prashant >> >> >> >> -- >> View this message in context: >> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/global-window-trigger-tp14206p14239.html >> >> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/global-window-trigger-tp14206p14239.html> >> Sent from the Apache Flink User Mailing List archive. mailing list archive >> at Nabble.com <http://nabble.com/>. >> > >