Class WindowTriggerContext<K,IN,W extends org.apache.flink.streaming.api.windowing.windows.Window>
java.lang.Object
org.apache.flink.datastream.impl.extension.window.context.WindowTriggerContext<K,IN,W>
- Type Parameters:
K- Type of the key.IN- Type of the input value.W- Type of the window.
- All Implemented Interfaces:
org.apache.flink.streaming.api.windowing.triggers.Trigger.OnMergeContext,org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
public class WindowTriggerContext<K,IN,W extends org.apache.flink.streaming.api.windowing.windows.Window>
extends Object
implements org.apache.flink.streaming.api.windowing.triggers.Trigger.OnMergeContext
WindowTriggerContext is a utility for handling Trigger invocations. It can be
reused by setting the key and window fields.-
Constructor Summary
ConstructorsConstructorDescriptionWindowTriggerContext(K key, W window, org.apache.flink.streaming.api.operators.AbstractStreamOperator<?> operator, org.apache.flink.streaming.api.operators.InternalTimerService<W> internalTimerService, org.apache.flink.streaming.api.windowing.triggers.Trigger<? super IN, ? super W> trigger, org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voiddeleteEventTimeTimer(long time) voiddeleteProcessingTimeTimer(long time) longlongGet current event time.getKey()org.apache.flink.metrics.MetricGroup<S extends org.apache.flink.api.common.state.State>
SgetPartitionedState(org.apache.flink.api.common.state.StateDescriptor<S, ?> stateDescriptor) <S extends org.apache.flink.api.common.state.MergingState<?,?>>
voidmergePartitionedState(org.apache.flink.api.common.state.StateDescriptor<S, ?> stateDescriptor) org.apache.flink.streaming.api.windowing.triggers.TriggerResultorg.apache.flink.streaming.api.windowing.triggers.TriggerResultonEventTime(long time) voidonMerge(Collection<W> mergedWindows) org.apache.flink.streaming.api.windowing.triggers.TriggerResultonProcessingTime(long time) voidregisterEventTimeTimer(long time) voidregisterProcessingTimeTimer(long time) voidvoidtoString()
-
Constructor Details
-
WindowTriggerContext
public WindowTriggerContext(K key, W window, org.apache.flink.streaming.api.operators.AbstractStreamOperator<?> operator, org.apache.flink.streaming.api.operators.InternalTimerService<W> internalTimerService, org.apache.flink.streaming.api.windowing.triggers.Trigger<? super IN, ? super W> trigger, org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer)
-
-
Method Details
-
getMetricGroup
public org.apache.flink.metrics.MetricGroup getMetricGroup()- Specified by:
getMetricGroupin interfaceorg.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
-
getCurrentWatermark
public long getCurrentWatermark()Get current event time.- Specified by:
getCurrentWatermarkin interfaceorg.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
-
getPartitionedState
public <S extends org.apache.flink.api.common.state.State> S getPartitionedState(org.apache.flink.api.common.state.StateDescriptor<S, ?> stateDescriptor) - Specified by:
getPartitionedStatein interfaceorg.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
-
mergePartitionedState
public <S extends org.apache.flink.api.common.state.MergingState<?,?>> void mergePartitionedState(org.apache.flink.api.common.state.StateDescriptor<S, ?> stateDescriptor) - Specified by:
mergePartitionedStatein interfaceorg.apache.flink.streaming.api.windowing.triggers.Trigger.OnMergeContext
-
getCurrentProcessingTime
public long getCurrentProcessingTime()- Specified by:
getCurrentProcessingTimein interfaceorg.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
-
registerProcessingTimeTimer
public void registerProcessingTimeTimer(long time) - Specified by:
registerProcessingTimeTimerin interfaceorg.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
-
registerEventTimeTimer
public void registerEventTimeTimer(long time) - Specified by:
registerEventTimeTimerin interfaceorg.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
-
deleteProcessingTimeTimer
public void deleteProcessingTimeTimer(long time) - Specified by:
deleteProcessingTimeTimerin interfaceorg.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
-
deleteEventTimeTimer
public void deleteEventTimeTimer(long time) - Specified by:
deleteEventTimeTimerin interfaceorg.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
-
onElement
public org.apache.flink.streaming.api.windowing.triggers.TriggerResult onElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> element) throws Exception - Throws:
Exception
-
onProcessingTime
public org.apache.flink.streaming.api.windowing.triggers.TriggerResult onProcessingTime(long time) throws Exception - Throws:
Exception
-
onEventTime
public org.apache.flink.streaming.api.windowing.triggers.TriggerResult onEventTime(long time) throws Exception - Throws:
Exception
-
onMerge
- Throws:
Exception
-
clear
- Throws:
Exception
-
toString
-
setKey
-
setWindow
-
getKey
-
getWindow
-