Interface SlicingWindowProcessor<W>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void advanceProgress​(long progress)
      Advances the progress time, the progress time is watermark if working in event-time mode, or current processing time if working in processing-time mode.
      void clearWindow​(W window)
      Clear state and resources associated with the given window namespace.
      void close()
      The tear-down method of the function.
      org.apache.flink.api.common.typeutils.TypeSerializer<W> createWindowSerializer()
      Returns the serializer of the window type.
      void fireWindow​(W window)
      Emit results of the given window.
      void initializeWatermark​(long watermark)
      Initializes the watermark which restores from state.
      void open​(SlicingWindowProcessor.Context<W> context)
      Initialization method for the function.
      void prepareCheckpoint()
      Performs a preparation before checkpoint.
      boolean processElement​(org.apache.flink.table.data.RowData key, org.apache.flink.table.data.RowData element)
      Process an element with associated key from the input stream.
    • Method Detail

      • initializeWatermark

        void initializeWatermark​(long watermark)
        Initializes the watermark which restores from state. The method is called after open method and before the actual working methods.
        Parameters:
        watermark - the initial watermark
      • processElement

        boolean processElement​(org.apache.flink.table.data.RowData key,
                               org.apache.flink.table.data.RowData element)
                        throws Exception
        Process an element with associated key from the input stream. Returns true if this element is dropped because of late arrival.
        Parameters:
        key - the key associated with the element
        element - The element to process.
        Throws:
        Exception
      • advanceProgress

        void advanceProgress​(long progress)
                      throws Exception
        Advances the progress time, the progress time is watermark if working in event-time mode, or current processing time if working in processing-time mode.

        This will potentially flush buffered data into states, because the watermark advancement may be in a very small step, but we don't need to flush buffered data for every watermark advancement.

        Parameters:
        progress - the current progress time
        Throws:
        Exception
      • prepareCheckpoint

        void prepareCheckpoint()
                        throws Exception
        Performs a preparation before checkpoint. This usually flushes buffered data into state.
        Throws:
        Exception
      • fireWindow

        void fireWindow​(W window)
                 throws Exception
        Emit results of the given window.

        Note: the key context has been set.

        Parameters:
        window - the window to emit
        Throws:
        Exception
      • clearWindow

        void clearWindow​(W window)
                  throws Exception
        Clear state and resources associated with the given window namespace.

        Note: the key context has been set.

        Parameters:
        window - the window to clear
        Throws:
        Exception
      • close

        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
      • createWindowSerializer

        org.apache.flink.api.common.typeutils.TypeSerializer<W> createWindowSerializer()
        Returns the serializer of the window type.