Class ContinuousProcessingTimeTrigger<W extends org.apache.flink.streaming.api.windowing.windows.Window>

  • Type Parameters:
    W - The type of Windows on which this trigger can operate.
    All Implemented Interfaces:
    Serializable

    @PublicEvolving
    public class ContinuousProcessingTimeTrigger<W extends org.apache.flink.streaming.api.windowing.windows.Window>
    extends org.apache.flink.streaming.api.windowing.triggers.Trigger<Object,​W>
    A Trigger that continuously fires based on a given time interval as measured by the clock of the machine on which the job is running.
    See Also:
    Serialized Form
    • 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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canMerge()  
      void clear​(W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx)  
      long getInterval()  
      static <W extends org.apache.flink.streaming.api.windowing.windows.Window>
      ContinuousProcessingTimeTrigger<W>
      of​(Duration interval)
      Creates a trigger that continuously fires based on the given interval.
      org.apache.flink.streaming.api.windowing.triggers.TriggerResult onElement​(Object element, long timestamp, W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx)  
      org.apache.flink.streaming.api.windowing.triggers.TriggerResult onEventTime​(long time, W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx)  
      void onMerge​(W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.OnMergeContext ctx)  
      org.apache.flink.streaming.api.windowing.triggers.TriggerResult onProcessingTime​(long time, W window, org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx)  
      String toString()  
    • Method Detail

      • onElement

        public org.apache.flink.streaming.api.windowing.triggers.TriggerResult onElement​(Object element,
                                                                                         long timestamp,
                                                                                         W window,
                                                                                         org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx)
                                                                                  throws Exception
        Specified by:
        onElement in class org.apache.flink.streaming.api.windowing.triggers.Trigger<Object,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
        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)
                                                                                    throws Exception
        Specified by:
        onEventTime in class org.apache.flink.streaming.api.windowing.triggers.Trigger<Object,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
        Throws:
        Exception
      • 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
        Specified by:
        onProcessingTime in class org.apache.flink.streaming.api.windowing.triggers.Trigger<Object,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
        Throws:
        Exception
      • clear

        public void clear​(W window,
                          org.apache.flink.streaming.api.windowing.triggers.Trigger.TriggerContext ctx)
                   throws Exception
        Specified by:
        clear in class org.apache.flink.streaming.api.windowing.triggers.Trigger<Object,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
        Throws:
        Exception
      • canMerge

        public boolean canMerge()
        Overrides:
        canMerge in class org.apache.flink.streaming.api.windowing.triggers.Trigger<Object,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
      • onMerge

        public void onMerge​(W window,
                            org.apache.flink.streaming.api.windowing.triggers.Trigger.OnMergeContext ctx)
                     throws Exception
        Overrides:
        onMerge in class org.apache.flink.streaming.api.windowing.triggers.Trigger<Object,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
        Throws:
        Exception
      • getInterval

        @VisibleForTesting
        public long getInterval()
      • of

        public static <W extends org.apache.flink.streaming.api.windowing.windows.Window> ContinuousProcessingTimeTrigger<W> of​(Duration interval)
        Creates a trigger that continuously fires based on the given interval.
        Type Parameters:
        W - The type of Windows on which this trigger can operate.
        Parameters:
        interval - The time interval at which to fire.