Class IterativeStream.ConnectedIterativeStreams<I,F>
- java.lang.Object
-
- org.apache.flink.streaming.api.datastream.ConnectedStreams<I,F>
-
- org.apache.flink.streaming.api.datastream.IterativeStream.ConnectedIterativeStreams<I,F>
-
- Type Parameters:
I- Type of the input of the iterationF- Type of the feedback of the iteration
- Enclosing class:
- IterativeStream<T>
@Public public static class IterativeStream.ConnectedIterativeStreams<I,F> extends ConnectedStreams<I,F>
TheIterativeStream.ConnectedIterativeStreamsrepresent 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 aConnectedStreams.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.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.streaming.api.datastream.ConnectedStreams
environment, inputStream1, inputStream2
-
-
Constructor Summary
Constructors Constructor Description ConnectedIterativeStreams(DataStream<I> input, org.apache.flink.api.common.typeinfo.TypeInformation<F> feedbackType, long waitTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataStream<F>closeWith(DataStream<F> feedbackStream)Closes the iteration.ConnectedStreams<I,F>keyBy(int[] keyPositions1, int[] keyPositions2)KeyBy operation for connected data stream.ConnectedStreams<I,F>keyBy(String[] fields1, String[] fields2)KeyBy operation for connected data stream using key expressions.ConnectedStreams<I,F>keyBy(String field1, String field2)KeyBy operation for connected data stream using key expressions.<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)KeyBy operation for connected data stream.<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)KeyBy operation for connected data stream.-
Methods inherited from class org.apache.flink.streaming.api.datastream.ConnectedStreams
flatMap, flatMap, getExecutionEnvironment, getFirstInput, getSecondInput, getType1, getType2, keyBy, map, map, process, process, process, process, transform, transform
-
-
-
-
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 theConnectedStreams.- Parameters:
feedbackStream-DataStreamthat 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:ConnectedStreamsKeyBy operation for connected data stream. Assigns keys to the elements of input1 and input2 according to keyPositions1 and keyPositions2.- Overrides:
keyByin classConnectedStreams<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:ConnectedStreamsKeyBy 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 theDataStreamS underlying type. A dot can be used to drill down into objects, as in"field1.getInnerField2()".- Overrides:
keyByin classConnectedStreams<I,F>- Parameters:
field1- The grouping expression for the first inputfield2- 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:ConnectedStreamsKeyBy 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 theDataStreamS underlying type. A dot can be used to drill down into objects, as in"field1.getInnerField2()".- Overrides:
keyByin classConnectedStreams<I,F>- Parameters:
fields1- The grouping expressions for the first inputfields2- 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:ConnectedStreamsKeyBy operation for connected data stream. Assigns keys to the elements of input1 and input2 using keySelector1 and keySelector2.- Overrides:
keyByin classConnectedStreams<I,F>- Parameters:
keySelector1- TheKeySelectorused for grouping the first inputkeySelector2- TheKeySelectorused 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:ConnectedStreamsKeyBy 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:
keyByin classConnectedStreams<I,F>- Parameters:
keySelector1- TheKeySelectorused for grouping the first inputkeySelector2- TheKeySelectorused for grouping the second inputkeyType- The type information of the common key type.- Returns:
- The partitioned
ConnectedStreams
-
-