public static final class ProcessingTimeTriggers.AfterEndOfWindow<W extends Window> extends WindowTrigger<W>
Trigger
that fires once the current system time passes the end of the window to
which a pane belongs.Trigger.OnMergeContext, Trigger.TriggerContext
ctx
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
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() |
ProcessingTimeTriggers.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 processing time has passed the end of the window. |
triggerTime
public ProcessingTimeTriggers.AfterEndOfWindowNoLate<W> withEarlyFirings(Trigger<W> earlyFirings)
Trigger
like the this, except that it fires repeatedly whenever the
given Trigger
fires before the processing time has passed the end of the window.public void open(Trigger.TriggerContext ctx) throws Exception
Trigger
public boolean onElement(Object element, long timestamp, W window) throws Exception
Trigger
public boolean onProcessingTime(long time, W window) throws Exception
Trigger
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.
onProcessingTime
in class Trigger<W extends Window>
time
- The timestamp at which the timer fired.window
- The window for which the timer fired.Exception
public boolean onEventTime(long time, W window) throws Exception
Trigger
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.
onEventTime
in class Trigger<W extends Window>
time
- The timestamp at which the timer fired.window
- The window for which the timer fired.Exception
public void clear(W window) throws Exception
Trigger
Trigger.TriggerContext.registerEventTimeTimer(long)
and
Trigger.TriggerContext.registerProcessingTimeTimer(long)
should be deleted here as well as
state acquired using TriggerContext#getPartitionedState(StateDescriptor)
.public boolean canMerge()
Trigger
If this returns true
you must properly implement Trigger.onMerge(Window,
OnMergeContext)
public void onMerge(W window, Trigger.OnMergeContext mergeContext) throws Exception
Trigger
WindowAssigner
.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.