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
WindowTriggerContextis a utility for handlingTriggerinvocations. It can be reused by setting thekeyandwindowfields.
-
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voiddeleteEventTimeTimer(long time)voiddeleteProcessingTimeTimer(long time)longgetCurrentProcessingTime()longgetCurrentWatermark()Get current event time.KgetKey()org.apache.flink.metrics.MetricGroupgetMetricGroup()<S extends org.apache.flink.api.common.state.State>
SgetPartitionedState(org.apache.flink.api.common.state.StateDescriptor<S,?> stateDescriptor)WgetWindow()<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.TriggerResultonElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> element)org.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)voidsetKey(K key)voidsetWindow(W window)StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
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
public void onMerge(Collection<W> mergedWindows) throws Exception
- Throws:
Exception
-
setKey
public void setKey(K key)
-
setWindow
public void setWindow(W window)
-
getKey
public K getKey()
-
getWindow
public W getWindow()
-
-