Class DeltaTrigger<T,W extends org.apache.flink.streaming.api.windowing.windows.Window>
java.lang.Object
org.apache.flink.streaming.api.windowing.triggers.Trigger<T,W>
org.apache.flink.streaming.api.windowing.triggers.DeltaTrigger<T,W>
- Type Parameters:
W- The type ofWindowson which this trigger can operate.
- All Implemented Interfaces:
Serializable
@PublicEvolving
public class DeltaTrigger<T,W extends org.apache.flink.streaming.api.windowing.windows.Window>
extends org.apache.flink.streaming.api.windowing.triggers.Trigger<T,W>
A
Trigger that fires based on a DeltaFunction and a threshold.
This trigger calculates a delta between the data point which triggered last and the currently arrived data point. It triggers if the delta is higher than a specified threshold.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.streaming.api.windowing.triggers.Trigger
org.apache.flink.streaming.api.windowing.triggers.Trigger.OnMergeContext, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic <T,W extends org.apache.flink.streaming.api.windowing.windows.Window>
DeltaTrigger<T,W> of(double threshold, DeltaFunction<T> deltaFunction, org.apache.flink.api.common.typeutils.TypeSerializer<T> stateSerializer) Creates a delta trigger from the given threshold andDeltaFunction.org.apache.flink.streaming.api.windowing.triggers.TriggerResultonElement(T element, long timestamp, W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx) org.apache.flink.streaming.api.windowing.triggers.TriggerResultonEventTime(long time, W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx) org.apache.flink.streaming.api.windowing.triggers.TriggerResultonProcessingTime(long time, W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx) toString()Methods inherited from class org.apache.flink.streaming.api.windowing.triggers.Trigger
canMerge, onMerge
-
Method Details
-
onElement
-
onEventTime
public org.apache.flink.streaming.api.windowing.triggers.TriggerResult onEventTime(long time, W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx) -
onProcessingTime
-
clear
-
toString
-
of
public static <T,W extends org.apache.flink.streaming.api.windowing.windows.Window> DeltaTrigger<T,W> of(double threshold, DeltaFunction<T> deltaFunction, org.apache.flink.api.common.typeutils.TypeSerializer<T> stateSerializer) Creates a delta trigger from the given threshold andDeltaFunction.- Type Parameters:
T- The type of elements on which this trigger can operate.W- The type ofWindowson which this trigger can operate.- Parameters:
threshold- The threshold at which to trigger.deltaFunction- The delta function to usestateSerializer- TypeSerializer for the data elements.
-