This is my definiton of the trigger for more clarity into the issue I am running:
@Override public TriggerResult onElement(FlatObject t, long l, Window w, TriggerContext tc) throws Exception { long currentTimeInCycle = t.getCurrentTimeInCycle(); if (lastKnownCurrentTimeInCycle > currentTimeInCycle) { lastKnownCurrentTimeInCycle = 0; return TriggerResult.FIRE_AND_PURGE; } lastKnownCurrentTimeInCycle = currentTimeInCycle; return TriggerResult.CONTINUE; } On Mon, Jan 23, 2017 at 10:02 PM, Abdul Salam Shaikh < abd.salam.sha...@gmail.com> wrote: > Thank you Jonas, I am using version *1.2-SNAPSHOT* of Apache Flink to > leverage the advanced Evictor class. > > However, while trying to use FIRE_AND_PURGE I am getting the following > error: > > java.lang.UnsupportedOperationException: Not supported yet. > at de.traffic.ui.streaming.WindowCustomTrigger.clear( > WindowCustomTrigger.java:51) > at org.apache.flink.streaming.runtime.operators.windowing. > WindowOperator$Context.clear(WindowOperator.java:643) > at org.apache.flink.streaming.runtime.operators.windowing. > WindowOperator.cleanup(WindowOperator.java:421) > at org.apache.flink.streaming.runtime.operators.windowing. > WindowOperator.processElement(WindowOperator.java:321) > at org.apache.flink.streaming.runtime.io.StreamInputProcessor. > processInput(StreamInputProcessor.java:185) > at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask.run( > OneInputStreamTask.java:63) > at org.apache.flink.streaming.runtime.tasks.StreamTask. > invoke(StreamTask.java:269) > at org.apache.flink.runtime.taskmanager.Task.run(Task.java:654) > at java.lang.Thread.run(Thread.java:745) > > Do we have support for this functionality in *1.2-SNAPSHOT* ? > > Thanks. > > On Mon, Jan 23, 2017 at 10:57 AM, Jonas <jo...@huntun.de> wrote: > >> The documentation says >> >> https://flink.apache.org/news/2015/12/04/Introducing-windows.html wrote >> > On each event, a trigger can decide to fire (i.e., evaluate), purge >> > (remove the window and discard its content), or fire and then purge the >> > window. A trigger that just fires evaluates the window and keeps it as >> it >> > is, i.e., all elements remain in the window and are evaluated again when >> > the triggers fires the next time. >> >> So you can choose between *Fire*, *Purge* and *Fire&Purge*. Seems like >> selected *Fire* but meant to choose *Fire&Purge*. >> >> From what it seems you want a PurgingTrigger. You also didn't state what >> version of Flink you are using :) >> >> -- Jonas >> >> >> >> -- >> View this message in context: http://apache-flink-user-maili >> ng-list-archive.2336050.n4.nabble.com/Expected-behaviour- >> of-windows-tp11200p11205.html >> Sent from the Apache Flink User Mailing List archive. mailing list >> archive at Nabble.com. >> > > > > -- > Thanks & Regards, > > *Abdul Salam Shaikh* > > -- Thanks & Regards, *Abdul Salam Shaikh*