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 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:
      getMetricGroup in interface org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
    • getCurrentWatermark

      public long getCurrentWatermark()
      Get current event time.
      Specified by:
      getCurrentWatermark in interface org.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:
      getPartitionedState in interface org.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:
      mergePartitionedState in interface org.apache.flink.streaming.api.windowing.triggers.Trigger.OnMergeContext
    • getCurrentProcessingTime

      public long getCurrentProcessingTime()
      Specified by:
      getCurrentProcessingTime in interface org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
    • registerProcessingTimeTimer

      public void registerProcessingTimeTimer(long time)
      Specified by:
      registerProcessingTimeTimer in interface org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
    • registerEventTimeTimer

      public void registerEventTimeTimer(long time)
      Specified by:
      registerEventTimeTimer in interface org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
    • deleteProcessingTimeTimer

      public void deleteProcessingTimeTimer(long time)
      Specified by:
      deleteProcessingTimeTimer in interface org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext
    • deleteEventTimeTimer

      public void deleteEventTimeTimer(long time)
      Specified by:
      deleteEventTimeTimer in interface org.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
    • clear

      public void clear() throws Exception
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setKey

      public void setKey(K key)
    • setWindow

      public void setWindow(W window)
    • getKey

      public K getKey()
    • getWindow

      public W getWindow()