public static final class EventTimeTriggers.AfterEndOfWindow<W extends Window> extends WindowTrigger<W>
Trigger that fires once the watermark passes the end of the window to which a pane
belongs.Watermark,
Serialized FormTrigger.OnMergeContext, Trigger.TriggerContextctx| Constructor and Description |
|---|
AfterEndOfWindow() |
| Modifier and Type | Method and 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 the
org.apache.flink.streaming.api.windowing.assigners.WindowAssigner. |
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 new
Trigger like the this, except that it fires repeatedly whenever the
given Trigger fires before the watermark has passed the end of the window. |
Trigger<W> |
withLateFirings(Trigger<W> lateFirings)
Creates a new
Trigger like the this, except that it fires repeatedly whenever the
given Trigger fires after the watermark has passed the end of the window. |
triggerTimepublic EventTimeTriggers.AfterEndOfWindowNoLate<W> withEarlyFirings(Trigger<W> earlyFirings)
Trigger like the this, except that it fires repeatedly whenever the
given Trigger fires before the watermark has passed the end of the window.public Trigger<W> withLateFirings(Trigger<W> lateFirings)
Trigger like the this, except that it fires repeatedly whenever the
given Trigger fires after the watermark has passed the end of the window.public void open(Trigger.TriggerContext ctx) throws Exception
Triggerpublic boolean onElement(Object element, long timestamp, W window) throws Exception
Triggerpublic boolean onProcessingTime(long time,
W window)
throws Exception
TriggerNote: 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.
onProcessingTime in class Trigger<W extends Window>time - The timestamp at which the timer fired.window - The window for which the timer fired.Exceptionpublic boolean onEventTime(long time,
W window)
throws Exception
TriggerNote: 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.
onEventTime in class Trigger<W extends Window>time - The timestamp at which the timer fired.window - The window for which the timer fired.Exceptionpublic void clear(W window) throws Exception
TriggerTrigger.TriggerContext.registerEventTimeTimer(long) and
Trigger.TriggerContext.registerProcessingTimeTimer(long) should be deleted here as well as
state acquired using TriggerContext#getPartitionedState(StateDescriptor).public boolean canMerge()
TriggerIf this returns true you must properly implement Trigger.onMerge(Window,
OnMergeContext)
public void onMerge(W window, Trigger.OnMergeContext mergeContext) throws Exception
Triggerorg.apache.flink.streaming.api.windowing.assigners.WindowAssigner.Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.