Class InternalWindowProcessFunction<K,​W extends Window>

    • Method Detail

      • assignStateNamespace

        public abstract Collection<W> assignStateNamespace​(org.apache.flink.table.data.RowData inputRow,
                                                           long timestamp)
                                                    throws Exception
        Assigns the input element into the state namespace which the input element should be accumulated/retracted into.
        Parameters:
        inputRow - the input element
        timestamp - the timestamp of the element or the processing time (depends on the type of assigner)
        Returns:
        the state namespace
        Throws:
        Exception
      • assignActualWindows

        public abstract Collection<W> assignActualWindows​(org.apache.flink.table.data.RowData inputRow,
                                                          long timestamp)
                                                   throws Exception
        Assigns the input element into the actual windows which the Trigger should trigger on.
        Parameters:
        inputRow - the input element
        timestamp - the timestamp of the element or the processing time (depends on the type of assigner)
        Returns:
        the actual windows
        Throws:
        Exception
      • prepareAggregateAccumulatorForEmit

        public abstract void prepareAggregateAccumulatorForEmit​(W window)
                                                         throws Exception
        Prepares the accumulator of the given window before emit the final result. The accumulator is stored in the state or will be created if there is no corresponding accumulator in state.
        Parameters:
        window - the window
        Throws:
        Exception
      • cleanWindowIfNeeded

        public abstract void cleanWindowIfNeeded​(W window,
                                                 long currentTime)
                                          throws Exception
        Cleans the given window if needed.
        Parameters:
        window - the window to cleanup
        currentTime - the current timestamp
        Throws:
        Exception
      • close

        public void close()
                   throws Exception
        The tear-down method of the function. It is called after the last call to the main working methods.
        Throws:
        Exception
      • isCleanupTime

        protected final boolean isCleanupTime​(W window,
                                              long time)
        Returns true if the given time is the cleanup time for the given window.
      • isWindowLate

        protected boolean isWindowLate​(W window)
        Returns true if the watermark is after the end timestamp plus the allowed lateness of the given window.