Class AsyncTriggerConverter.UserDefinedAsyncTrigger<T,W extends Window>
- java.lang.Object
-
- org.apache.flink.runtime.asyncprocessing.operators.windowing.triggers.AsyncTrigger<T,W>
-
- org.apache.flink.streaming.runtime.operators.windowing.AsyncTriggerConverter.UserDefinedAsyncTrigger<T,W>
-
- All Implemented Interfaces:
Serializable
- Enclosing interface:
- AsyncTriggerConverter
public static class AsyncTriggerConverter.UserDefinedAsyncTrigger<T,W extends Window> extends AsyncTrigger<T,W>
Convert non-support user-defined trigger toAsyncTrigger.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.asyncprocessing.operators.windowing.triggers.AsyncTrigger
AsyncTrigger.OnMergeContext, AsyncTrigger.TriggerContext
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.api.common.state.v2.StateFuture<Void>clear(W window, AsyncTrigger.TriggerContext ctx)Clears any state that the trigger might still hold for the given window.Trigger<T,W>getUserDefinedTrigger()booleanisEndOfStreamTrigger()Indicate whether the trigger only trigger at the end of stream.static <T,W extends Window>
AsyncTrigger<T,W>of(Trigger<T,W> userDefinedTrigger)org.apache.flink.api.common.state.v2.StateFuture<TriggerResult>onElement(T element, long timestamp, W 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, W window, AsyncTrigger.TriggerContext ctx)Called when an event-time timer that was set using the trigger context fires.org.apache.flink.api.common.state.v2.StateFuture<TriggerResult>onProcessingTime(long time, W window, AsyncTrigger.TriggerContext ctx)Called when a processing-time timer that was set using the trigger context fires.-
Methods inherited from class org.apache.flink.runtime.asyncprocessing.operators.windowing.triggers.AsyncTrigger
canMerge, onMerge
-
-
-
-
Method Detail
-
onElement
public org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onElement(T element, long timestamp, W 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<T,W extends Window>- 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
-
onProcessingTime
public org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onProcessingTime(long time, W 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<T,W extends Window>- 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
-
onEventTime
public org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onEventTime(long time, W window, AsyncTrigger.TriggerContext ctx) throws Exception
Description copied from class:AsyncTriggerCalled when an event-time timer that was set using the trigger context fires.- Specified by:
onEventTimein classAsyncTrigger<T,W extends Window>- 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(W 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).
-
isEndOfStreamTrigger
public boolean isEndOfStreamTrigger()
Description copied from class:AsyncTriggerIndicate whether the trigger only trigger at the end of stream.- Overrides:
isEndOfStreamTriggerin classAsyncTrigger<T,W extends Window>
-
of
public static <T,W extends Window> AsyncTrigger<T,W> of(Trigger<T,W> userDefinedTrigger)
-
-