Class EventTimeTriggers.AfterEndOfWindow<W extends Window>
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.window.groupwindow.triggers.Trigger<W>
-
- org.apache.flink.table.runtime.operators.window.groupwindow.triggers.WindowTrigger<W>
-
- org.apache.flink.table.runtime.operators.window.groupwindow.triggers.EventTimeTriggers.AfterEndOfWindow<W>
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- EventTimeTriggers
public static final class EventTimeTriggers.AfterEndOfWindow<W extends Window> extends WindowTrigger<W>
ATrigger
that fires once the watermark passes the end of the window to which a pane belongs.- See Also:
Watermark
, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.table.runtime.operators.window.groupwindow.triggers.Trigger
Trigger.OnMergeContext, Trigger.TriggerContext
-
-
Field Summary
-
Fields inherited from class org.apache.flink.table.runtime.operators.window.groupwindow.triggers.WindowTrigger
ctx
-
-
Constructor Summary
Constructors Constructor Description AfterEndOfWindow()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canMerge()
Returns true if this trigger supports merging of trigger state and can therefore.void
clear(W window)
Clears any state that the trigger might still hold for the given window.boolean
onElement(Object element, long timestamp, W window)
Called for every element that gets added to a pane.boolean
onEventTime(long time, W window)
Called when an event-time timer that was set using the trigger context fires.void
onMerge(W window, Trigger.OnMergeContext mergeContext)
Called when several windows have been merged into one window by theWindowAssigner
.boolean
onProcessingTime(long time, W window)
Called when a processing-time timer that was set using the trigger context fires.void
open(Trigger.TriggerContext ctx)
Initialization method for the trigger.String
toString()
EventTimeTriggers.AfterEndOfWindowNoLate<W>
withEarlyFirings(Trigger<W> earlyFirings)
Creates a newTrigger
like the this, except that it fires repeatedly whenever the givenTrigger
fires before the watermark has passed the end of the window.Trigger<W>
withLateFirings(Trigger<W> lateFirings)
Creates a newTrigger
like the this, except that it fires repeatedly whenever the givenTrigger
fires after the watermark has passed the end of the window.-
Methods inherited from class org.apache.flink.table.runtime.operators.window.groupwindow.triggers.WindowTrigger
triggerTime
-
-
-
-
Method Detail
-
withEarlyFirings
public EventTimeTriggers.AfterEndOfWindowNoLate<W> withEarlyFirings(Trigger<W> earlyFirings)
Creates a newTrigger
like the this, except that it fires repeatedly whenever the givenTrigger
fires before the watermark has passed the end of the window.
-
withLateFirings
public Trigger<W> withLateFirings(Trigger<W> lateFirings)
Creates a newTrigger
like the this, except that it fires repeatedly whenever the givenTrigger
fires after the watermark has passed the end of the window.
-
open
public void open(Trigger.TriggerContext ctx) throws Exception
Description copied from class:Trigger
Initialization method for the trigger. Creates states in this method.
-
onElement
public boolean onElement(Object element, long timestamp, W window) throws Exception
Description copied from class:Trigger
Called for every element that gets added to a pane. The result of this will determine whether the pane is evaluated to emit results.
-
onProcessingTime
public boolean onProcessingTime(long time, W window) throws Exception
Description copied from class:Trigger
Called when a processing-time timer that was set using the trigger context fires.Note: This method is not called in case the window does not contain any elements. Thus, if you return
PURGE
from a trigger method and you expect to do cleanup in a future invocation of a timer callback it might be wise to clean any state that you would clean in the timer callback.- Specified by:
onProcessingTime
in classTrigger<W extends Window>
- Parameters:
time
- The timestamp at which the timer fired.window
- The window for which the timer fired.- Returns:
- true for firing the window, false for no action
- Throws:
Exception
-
onEventTime
public boolean onEventTime(long time, W window) throws Exception
Description copied from class:Trigger
Called when an event-time timer that was set using the trigger context fires.Note: This method is not called in case the window does not contain any elements. Thus, if you return
PURGE
from a trigger method and you expect to do cleanup in a future invocation of a timer callback it might be wise to clean any state that you would clean in the timer callback.- Specified by:
onEventTime
in classTrigger<W extends Window>
- Parameters:
time
- The timestamp at which the timer fired.window
- The window for which the timer fired.- Returns:
- true for firing the window, false for no action
- Throws:
Exception
-
clear
public void clear(W window) throws Exception
Description copied from class:Trigger
Clears any state that the trigger might still hold for the given window. This is called when a window is purged. Timers set usingTrigger.TriggerContext.registerEventTimeTimer(long)
andTrigger.TriggerContext.registerProcessingTimeTimer(long)
should be deleted here as well as state acquired usingTriggerContext#getPartitionedState(StateDescriptor)
.
-
canMerge
public boolean canMerge()
Description copied from class:Trigger
Returns true if this trigger supports merging of trigger state and can therefore.If this returns
true
you must properly implementTrigger.onMerge(Window, OnMergeContext)
-
onMerge
public void onMerge(W window, Trigger.OnMergeContext mergeContext) throws Exception
Description copied from class:Trigger
Called when several windows have been merged into one window by theWindowAssigner
.
-
-