@ Override public TriggerResult onElement ( Object element , long timestamp , TimeWindow window , TriggerContext ctx ) { ctx . registerEventTimeTimer ( window . getEnd ( ) + ctx . getMaxLagMs ( ) , window ) ; return TriggerResult . CONTINUE ; }
If a watermark arrives we need to check all pending windows . If any of the pending window suffices we should fire immediately by registering a timer without delay . Otherwise we register a timer whose time is the window end plus max lag time