Class IterativeStream.ConnectedIterativeStreams<I,​F>

  • Type Parameters:
    I - Type of the input of the iteration
    F - Type of the feedback of the iteration
    Enclosing class:
    IterativeStream<T>

    @Public
    public static class IterativeStream.ConnectedIterativeStreams<I,​F>
    extends ConnectedStreams<I,​F>
    The IterativeStream.ConnectedIterativeStreams represent a start of an iterative part of a streaming program, where the original input of the iteration and the feedback of the iteration are connected as in a ConnectedStreams.

    The user can distinguish between the two inputs using co-transformation, thus eliminating the need for mapping the inputs and outputs to a common type.

    • Constructor Detail

      • ConnectedIterativeStreams

        public ConnectedIterativeStreams​(DataStream<I> input,
                                         org.apache.flink.api.common.typeinfo.TypeInformation<F> feedbackType,
                                         long waitTime)
    • Method Detail

      • closeWith

        public DataStream<F> closeWith​(DataStream<F> 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 as the second input in the ConnectedStreams.
        Parameters:
        feedbackStream - DataStream that will be used as second input to the iteration head.
        Returns:
        The feedback stream.
      • keyBy

        public ConnectedStreams<I,​F> keyBy​(int[] keyPositions1,
                                                 int[] keyPositions2)
        Description copied from class: ConnectedStreams
        KeyBy operation for connected data stream. Assigns keys to the elements of input1 and input2 according to keyPositions1 and keyPositions2.
        Overrides:
        keyBy in class ConnectedStreams<I,​F>
        Parameters:
        keyPositions1 - The fields used to group the first input stream.
        keyPositions2 - The fields used to group the second input stream.
        Returns:
        The grouped ConnectedStreams
      • keyBy

        public ConnectedStreams<I,​F> keyBy​(String field1,
                                                 String field2)
        Description copied from class: ConnectedStreams
        KeyBy operation for connected data stream using key expressions. Assigns keys to the elements of input1 and input2 according to field1 and field2. A field expression is either the name of a public field or a getter method with parentheses of the DataStreamS underlying type. A dot can be used to drill down into objects, as in "field1.getInnerField2()" .
        Overrides:
        keyBy in class ConnectedStreams<I,​F>
        Parameters:
        field1 - The grouping expression for the first input
        field2 - The grouping expression for the second input
        Returns:
        The grouped ConnectedStreams
      • keyBy

        public ConnectedStreams<I,​F> keyBy​(String[] fields1,
                                                 String[] fields2)
        Description copied from class: ConnectedStreams
        KeyBy operation for connected data stream using key expressions. the elements of input1 and input2 according to fields1 and fields2. A field expression is either the name of a public field or a getter method with parentheses of the DataStreamS underlying type. A dot can be used to drill down into objects, as in "field1.getInnerField2()" .
        Overrides:
        keyBy in class ConnectedStreams<I,​F>
        Parameters:
        fields1 - The grouping expressions for the first input
        fields2 - The grouping expressions for the second input
        Returns:
        The grouped ConnectedStreams
      • keyBy

        public <KEY> ConnectedStreams<I,​F> keyBy​(org.apache.flink.api.java.functions.KeySelector<I,​KEY> keySelector1,
                                                       org.apache.flink.api.java.functions.KeySelector<F,​KEY> keySelector2)
        Description copied from class: ConnectedStreams
        KeyBy operation for connected data stream. Assigns keys to the elements of input1 and input2 using keySelector1 and keySelector2.
        Overrides:
        keyBy in class ConnectedStreams<I,​F>
        Parameters:
        keySelector1 - The KeySelector used for grouping the first input
        keySelector2 - The KeySelector used for grouping the second input
        Returns:
        The partitioned ConnectedStreams
      • keyBy

        public <KEY> ConnectedStreams<I,​F> keyBy​(org.apache.flink.api.java.functions.KeySelector<I,​KEY> keySelector1,
                                                       org.apache.flink.api.java.functions.KeySelector<F,​KEY> keySelector2,
                                                       org.apache.flink.api.common.typeinfo.TypeInformation<KEY> keyType)
        Description copied from class: ConnectedStreams
        KeyBy operation for connected data stream. Assigns keys to the elements of input1 and input2 using keySelector1 and keySelector2 with explicit type information for the common key type.
        Overrides:
        keyBy in class ConnectedStreams<I,​F>
        Parameters:
        keySelector1 - The KeySelector used for grouping the first input
        keySelector2 - The KeySelector used for grouping the second input
        keyType - The type information of the common key type.
        Returns:
        The partitioned ConnectedStreams