Class AsyncEventTimeTrigger
java.lang.Object
org.apache.flink.runtime.asyncprocessing.operators.windowing.triggers.AsyncTrigger<Object,TimeWindow>
org.apache.flink.runtime.asyncprocessing.operators.windowing.triggers.AsyncEventTimeTrigger
- All Implemented Interfaces:
Serializable
A
AsyncTrigger that fires once the watermark passes the end of the window to which a pane
belongs. This is for async window operator.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.runtime.asyncprocessing.operators.windowing.triggers.AsyncTrigger
AsyncTrigger.OnMergeContext, AsyncTrigger.TriggerContext -
Method Summary
Modifier and TypeMethodDescriptionbooleancanMerge()Returns true if this trigger supports merging of trigger state and can therefore be used with aMergingWindowAssigner.org.apache.flink.api.common.state.v2.StateFuture<Void>clear(TimeWindow window, AsyncTrigger.TriggerContext ctx) Clears any state that the trigger might still hold for the given window.static AsyncEventTimeTriggercreate()Creates an event-time trigger that fires once the watermark passes the end of the window.org.apache.flink.api.common.state.v2.StateFuture<TriggerResult>onElement(Object element, long timestamp, TimeWindow window, AsyncTrigger.TriggerContext ctx) Called for every element that gets added to a pane.org.apache.flink.api.common.state.v2.StateFuture<TriggerResult>onEventTime(long time, TimeWindow window, AsyncTrigger.TriggerContext ctx) Called when an event-time timer that was set using the trigger context fires.voidonMerge(TimeWindow window, AsyncTrigger.OnMergeContext ctx) Called when several windows have been merged into one window by theWindowAssigner.org.apache.flink.api.common.state.v2.StateFuture<TriggerResult>onProcessingTime(long time, TimeWindow window, AsyncTrigger.TriggerContext ctx) Called when a processing-time timer that was set using the trigger context fires.toString()Methods inherited from class org.apache.flink.runtime.asyncprocessing.operators.windowing.triggers.AsyncTrigger
isEndOfStreamTrigger
-
Method Details
-
onElement
public org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onElement(Object element, long timestamp, TimeWindow window, AsyncTrigger.TriggerContext ctx) throws Exception Description copied from class:AsyncTriggerCalled for every element that gets added to a pane. The result of this will determine whether the pane is evaluated to emit results.- Specified by:
onElementin classAsyncTrigger<Object,TimeWindow> - Parameters:
element- The element that arrived.timestamp- The timestamp of the element that arrived.window- The window to which the element is being added.ctx- A context object that can be used to register timer callbacks.- Throws:
Exception
-
onEventTime
public org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onEventTime(long time, TimeWindow window, AsyncTrigger.TriggerContext ctx) Description copied from class:AsyncTriggerCalled when an event-time timer that was set using the trigger context fires.- Specified by:
onEventTimein classAsyncTrigger<Object,TimeWindow> - Parameters:
time- The timestamp at which the timer fired.window- The window for which the timer fired.ctx- A context object that can be used to register timer callbacks.
-
onProcessingTime
public org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onProcessingTime(long time, TimeWindow window, AsyncTrigger.TriggerContext ctx) throws Exception Description copied from class:AsyncTriggerCalled when a processing-time timer that was set using the trigger context fires.- Specified by:
onProcessingTimein classAsyncTrigger<Object,TimeWindow> - Parameters:
time- The timestamp at which the timer fired.window- The window for which the timer fired.ctx- A context object that can be used to register timer callbacks.- Throws:
Exception
-
clear
public org.apache.flink.api.common.state.v2.StateFuture<Void> clear(TimeWindow window, AsyncTrigger.TriggerContext ctx) throws Exception Description copied from class:AsyncTriggerClears any state that the trigger might still hold for the given window. This is called when a window is purged. Timers set usingAsyncTrigger.TriggerContext.registerEventTimeTimer(long)andAsyncTrigger.TriggerContext.registerProcessingTimeTimer(long)should be deleted here as well as state acquired usingAsyncTrigger.TriggerContext.getPartitionedState(StateDescriptor).- Specified by:
clearin classAsyncTrigger<Object,TimeWindow> - Throws:
Exception
-
canMerge
public boolean canMerge()Description copied from class:AsyncTriggerReturns true if this trigger supports merging of trigger state and can therefore be used with aMergingWindowAssigner.If this returns
trueyou must properly implementAsyncTrigger.onMerge(Window, OnMergeContext)- Overrides:
canMergein classAsyncTrigger<Object,TimeWindow>
-
onMerge
Description copied from class:AsyncTriggerCalled when several windows have been merged into one window by theWindowAssigner.- Overrides:
onMergein classAsyncTrigger<Object,TimeWindow> - Parameters:
window- The new window that results from the merge.ctx- A context object that can be used to register timer callbacks and access state.
-
toString
-
create
Creates an event-time trigger that fires once the watermark passes the end of the window.Once the trigger fires all elements are discarded. Elements that arrive late immediately trigger window evaluation with just this one element.
-