Interface BroadcastStream<T>
- All Superinterfaces:
DataStream
-
Method Summary
Modifier and TypeMethodDescription<K,T_OTHER, OUT>
NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT>connectAndProcess(KeyedPartitionStream<K, T_OTHER> other, TwoInputBroadcastStreamProcessFunction<T_OTHER, T, OUT> processFunction) Apply a two input operation to this and otherKeyedPartitionStream.<K,T_OTHER, OUT>
KeyedPartitionStream.ProcessConfigurableAndKeyedPartitionStream<K,OUT> connectAndProcess(KeyedPartitionStream<K, T_OTHER> other, TwoInputBroadcastStreamProcessFunction<T_OTHER, T, OUT> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT, K> newKeySelector) Apply a two input operation to this and otherKeyedPartitionStream.<T_OTHER,OUT>
NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT>connectAndProcess(NonKeyedPartitionStream<T_OTHER> other, TwoInputBroadcastStreamProcessFunction<T_OTHER, T, OUT> processFunction) Apply a two input operation to this and otherNonKeyedPartitionStream.
-
Method Details
-
connectAndProcess
<K,T_OTHER, NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT> connectAndProcessOUT> (KeyedPartitionStream<K, T_OTHER> other, TwoInputBroadcastStreamProcessFunction<T_OTHER, T, OUT> processFunction) Apply a two input operation to this and otherKeyedPartitionStream.Generally, concatenating
BroadcastStreamandKeyedPartitionStreamwill result in aNonKeyedPartitionStream, and you can manually generate aKeyedPartitionStreamvia keyBy partitioning. In some cases, you can guarantee that the partition on which the data is processed will not change, then you can useconnectAndProcess(KeyedPartitionStream, TwoInputBroadcastStreamProcessFunction, KeySelector)to avoid shuffling.- Parameters:
other-KeyedPartitionStreamto perform operation with two input.processFunction- to perform operation.- Returns:
- new stream with this operation.
-
connectAndProcess
<T_OTHER,OUT> NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT> connectAndProcess(NonKeyedPartitionStream<T_OTHER> other, TwoInputBroadcastStreamProcessFunction<T_OTHER, T, OUT> processFunction) Apply a two input operation to this and otherNonKeyedPartitionStream.- Parameters:
other-NonKeyedPartitionStreamto perform operation with two input.processFunction- to perform operation.- Returns:
- new stream with this operation.
-
connectAndProcess
<K,T_OTHER, KeyedPartitionStream.ProcessConfigurableAndKeyedPartitionStream<K,OUT> OUT> connectAndProcess(KeyedPartitionStream<K, T_OTHER> other, TwoInputBroadcastStreamProcessFunction<T_OTHER, T, OUT> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT, K> newKeySelector) Apply a two input operation to this and otherKeyedPartitionStream.This method is used to avoid shuffle after applying the process function. It is required that for the record from non-broadcast input, the new
KeySelectormust extract the same key as the originalKeySelectors on theKeyedPartitionStream. Otherwise, the partition of data will be messy. As for the record from broadcast input, the output key from keyed partition itself instead of the new key selector, so the data it outputs will not affect the partition.- Parameters:
other-KeyedPartitionStreamto perform operation with two input.processFunction- to perform operation.newKeySelector- to select the key after process.- Returns:
- new
KeyedPartitionStreamwith this operation.
-