Class AsyncTrigger<T,​W extends Window>

    • Constructor Detail

      • AsyncTrigger

        public AsyncTrigger()
    • Method Detail

      • onElement

        public abstract org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onElement​(T element,
                                                                                                  long timestamp,
                                                                                                  W window,
                                                                                                  AsyncTrigger.TriggerContext ctx)
                                                                                           throws Exception
        Called for every element that gets added to a pane. The result of this will determine whether the pane is evaluated to emit results.
        Parameters:
        element - The element that arrived.
        timestamp - The timestamp of the element that arrived.
        window - The window to which the element is being added.
        ctx - A context object that can be used to register timer callbacks.
        Throws:
        Exception
      • onProcessingTime

        public abstract org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onProcessingTime​(long time,
                                                                                                         W window,
                                                                                                         AsyncTrigger.TriggerContext ctx)
                                                                                                  throws Exception
        Called when a processing-time timer that was set using the trigger context fires.
        Parameters:
        time - The timestamp at which the timer fired.
        window - The window for which the timer fired.
        ctx - A context object that can be used to register timer callbacks.
        Throws:
        Exception
      • onEventTime

        public abstract org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onEventTime​(long time,
                                                                                                    W window,
                                                                                                    AsyncTrigger.TriggerContext ctx)
                                                                                             throws Exception
        Called when an event-time timer that was set using the trigger context fires.
        Parameters:
        time - The timestamp at which the timer fired.
        window - The window for which the timer fired.
        ctx - A context object that can be used to register timer callbacks.
        Throws:
        Exception
      • onMerge

        public void onMerge​(W window,
                            AsyncTrigger.OnMergeContext ctx)
                     throws Exception
        Called when several windows have been merged into one window by the WindowAssigner.
        Parameters:
        window - The new window that results from the merge.
        ctx - A context object that can be used to register timer callbacks and access state.
        Throws:
        Exception
      • isEndOfStreamTrigger

        public boolean isEndOfStreamTrigger()
        Indicate whether the trigger only trigger at the end of stream.