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>ATriggerthat fires based on aDeltaFunctionand 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:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear(W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx)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.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)StringtoString()
-
-
-
Method Detail
-
onElement
public org.apache.flink.streaming.api.windowing.triggers.TriggerResult onElement(T element, long timestamp, W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx) throws Exception
-
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
public org.apache.flink.streaming.api.windowing.triggers.TriggerResult onProcessingTime(long time, W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx) throws Exception
-
clear
public void clear(W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx) throws Exception
-
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.
-
-