IN1
- The input type of the non-broadcast side.IN2
- The input type of the broadcast side.@PublicEvolving public class BroadcastConnectedStream<IN1,IN2> extends Object
BroadcastStream
with broadcast
state(s)
. As in the case of ConnectedStreams
these streams are useful for cases where
operations on one stream directly affect the operations on the other stream, usually via shared
state between the streams.
An example for the use of such connected streams would be to apply rules that change over time onto another, possibly keyed stream. The stream with the broadcast state has the rules, and will store them in the broadcast state, while the other stream will contain the elements to apply the rules to. By broadcasting the rules, these will be available in all parallel instances, and can be applied to all partitions of the other stream.
Modifier | Constructor and Description |
---|---|
protected |
BroadcastConnectedStream(StreamExecutionEnvironment env,
DataStream<IN1> input1,
BroadcastStream<IN2> input2,
List<MapStateDescriptor<?,?>> broadcastStateDescriptors) |
Modifier and Type | Method and Description |
---|---|
protected <F> F |
clean(F f) |
StreamExecutionEnvironment |
getExecutionEnvironment() |
DataStream<IN1> |
getFirstInput()
Returns the non-broadcast
DataStream . |
BroadcastStream<IN2> |
getSecondInput()
Returns the
BroadcastStream . |
TypeInformation<IN1> |
getType1()
Gets the type of the first input.
|
TypeInformation<IN2> |
getType2()
Gets the type of the second input.
|
<OUT> SingleOutputStreamOperator<OUT> |
process(BroadcastProcessFunction<IN1,IN2,OUT> function)
Assumes as inputs a
BroadcastStream and a non-keyed DataStream and applies
the given BroadcastProcessFunction on them, thereby creating a transformed output
stream. |
<OUT> SingleOutputStreamOperator<OUT> |
process(BroadcastProcessFunction<IN1,IN2,OUT> function,
TypeInformation<OUT> outTypeInfo)
Assumes as inputs a
BroadcastStream and a non-keyed DataStream and applies
the given BroadcastProcessFunction on them, thereby creating a transformed output
stream. |
<KEY,OUT> SingleOutputStreamOperator<OUT> |
process(KeyedBroadcastProcessFunction<KEY,IN1,IN2,OUT> function)
Assumes as inputs a
BroadcastStream and a KeyedStream and applies the given
KeyedBroadcastProcessFunction on them, thereby creating a transformed output stream. |
<KEY,OUT> SingleOutputStreamOperator<OUT> |
process(KeyedBroadcastProcessFunction<KEY,IN1,IN2,OUT> function,
TypeInformation<OUT> outTypeInfo)
Assumes as inputs a
BroadcastStream and a KeyedStream and applies the given
KeyedBroadcastProcessFunction on them, thereby creating a transformed output stream. |
protected BroadcastConnectedStream(StreamExecutionEnvironment env, DataStream<IN1> input1, BroadcastStream<IN2> input2, List<MapStateDescriptor<?,?>> broadcastStateDescriptors)
public StreamExecutionEnvironment getExecutionEnvironment()
public DataStream<IN1> getFirstInput()
DataStream
.public BroadcastStream<IN2> getSecondInput()
BroadcastStream
.public TypeInformation<IN1> getType1()
public TypeInformation<IN2> getType2()
@PublicEvolving public <KEY,OUT> SingleOutputStreamOperator<OUT> process(KeyedBroadcastProcessFunction<KEY,IN1,IN2,OUT> function)
BroadcastStream
and a KeyedStream
and applies the given
KeyedBroadcastProcessFunction
on them, thereby creating a transformed output stream.KEY
- The type of the keys in the keyed stream.OUT
- The type of the output elements.function
- The KeyedBroadcastProcessFunction
that is called for each element in
the stream.DataStream
.@PublicEvolving public <KEY,OUT> SingleOutputStreamOperator<OUT> process(KeyedBroadcastProcessFunction<KEY,IN1,IN2,OUT> function, TypeInformation<OUT> outTypeInfo)
BroadcastStream
and a KeyedStream
and applies the given
KeyedBroadcastProcessFunction
on them, thereby creating a transformed output stream.KEY
- The type of the keys in the keyed stream.OUT
- The type of the output elements.function
- The KeyedBroadcastProcessFunction
that is called for each element in
the stream.outTypeInfo
- The type of the output elements.DataStream
.@PublicEvolving public <OUT> SingleOutputStreamOperator<OUT> process(BroadcastProcessFunction<IN1,IN2,OUT> function)
BroadcastStream
and a non-keyed DataStream
and applies
the given BroadcastProcessFunction
on them, thereby creating a transformed output
stream.OUT
- The type of the output elements.function
- The BroadcastProcessFunction
that is called for each element in the
stream.DataStream
.@PublicEvolving public <OUT> SingleOutputStreamOperator<OUT> process(BroadcastProcessFunction<IN1,IN2,OUT> function, TypeInformation<OUT> outTypeInfo)
BroadcastStream
and a non-keyed DataStream
and applies
the given BroadcastProcessFunction
on them, thereby creating a transformed output
stream.OUT
- The type of the output elements.function
- The BroadcastProcessFunction
that is called for each element in the
stream.outTypeInfo
- The type of the output elements.DataStream
.protected <F> F clean(F f)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.