Class IterativeStream<T>

  • Type Parameters:
    T - Type of the elements in this Stream

    @PublicEvolving
    public class IterativeStream<T>
    extends SingleOutputStreamOperator<T>
    The iterative data stream represents the start of an iteration in a DataStream.
    • Constructor Detail

      • IterativeStream

        protected IterativeStream​(DataStream<T> dataStream,
                                  long maxWaitTime)
    • Method Detail

      • closeWith

        public DataStream<T> closeWith​(DataStream<T> feedbackStream)
        Closes the iteration. This method defines the end of the iterative program part that will be fed back to the start of the iteration.

        A common usage pattern for streaming iterations is to use output splitting to send a part of the closing data stream to the head. Refer to ProcessFunction.Context.output(OutputTag, Object) for more information.

        Parameters:
        feedbackStream - DataStream that will be used as input to the iteration head.
        Returns:
        The feedback stream.
      • withFeedbackType

        public <F> IterativeStream.ConnectedIterativeStreams<T,​F> withFeedbackType​(org.apache.flink.api.common.typeinfo.TypeHint<F> feedbackTypeHint)
        Changes the feedback type of the iteration and allows the user to apply co-transformations on the input and feedback stream, as in a ConnectedStreams.

        For type safety the user needs to define the feedback type

        Parameters:
        feedbackTypeHint - Class of the elements in the feedback stream.
        Returns:
        A IterativeStream.ConnectedIterativeStreams.
      • withFeedbackType

        public <F> IterativeStream.ConnectedIterativeStreams<T,​F> withFeedbackType​(org.apache.flink.api.common.typeinfo.TypeInformation<F> feedbackType)
        Changes the feedback type of the iteration and allows the user to apply co-transformations on the input and feedback stream, as in a ConnectedStreams.

        For type safety the user needs to define the feedback type

        Parameters:
        feedbackType - The type information of the feedback stream.
        Returns:
        A IterativeStream.ConnectedIterativeStreams.