Class KeyedPartitionStreamImpl<K,V>

java.lang.Object
org.apache.flink.datastream.impl.stream.AbstractDataStream<V>
org.apache.flink.datastream.impl.stream.KeyedPartitionStreamImpl<K,V>
All Implemented Interfaces:
org.apache.flink.datastream.api.stream.DataStream, org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>

public class KeyedPartitionStreamImpl<K,V> extends AbstractDataStream<V> implements org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
The implementation of KeyedPartitionStream.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.flink.datastream.api.stream.KeyedPartitionStream

    org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndKeyedPartitionStream<K extends Object,T extends Object>, org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndTwoKeyedPartitionStreams<K extends Object,T1 extends Object,T2 extends Object>
  • Field Summary

    Fields inherited from class org.apache.flink.datastream.impl.stream.AbstractDataStream

    environment, requestedSideOutputs, transformation
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeyedPartitionStreamImpl(AbstractDataStream<V> dataStream, org.apache.flink.api.dag.Transformation<V> partitionTransformation, org.apache.flink.api.java.functions.KeySelector<V,K> keySelector, org.apache.flink.api.common.typeinfo.TypeInformation<K> keyType)
    This can construct a keyed stream directly without partitionTransformation to avoid shuffle.
    KeyedPartitionStreamImpl(AbstractDataStream<V> dataStream, org.apache.flink.api.java.functions.KeySelector<V,K> keySelector)
     
    KeyedPartitionStreamImpl(AbstractDataStream<V> dataStream, org.apache.flink.api.java.functions.KeySelector<V,K> keySelector, org.apache.flink.api.common.typeinfo.TypeInformation<K> keyType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.flink.datastream.api.stream.BroadcastStream<V>
     
    <T_OTHER, OUT>
    org.apache.flink.datastream.api.stream.NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT>
    connectAndProcess(org.apache.flink.datastream.api.stream.BroadcastStream<T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction)
     
    <T_OTHER, OUT>
    org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndKeyedPartitionStream<K,OUT>
    connectAndProcess(org.apache.flink.datastream.api.stream.BroadcastStream<T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT,K> newKeySelector)
     
    <T_OTHER, OUT>
    org.apache.flink.datastream.api.stream.NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT>
    connectAndProcess(org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputNonBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction)
     
    <T_OTHER, OUT>
    org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndKeyedPartitionStream<K,OUT>
    connectAndProcess(org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputNonBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT,K> newKeySelector)
     
    <T_OTHER, OUT>
    org.apache.flink.api.dag.Transformation<OUT>
    getJoinTransformation(org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputNonBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo)
     
    org.apache.flink.api.java.functions.KeySelector<V,K>
     
    org.apache.flink.api.common.typeinfo.TypeInformation<K>
     
    org.apache.flink.datastream.api.stream.GlobalStream<V>
     
    <NEW_KEY> org.apache.flink.datastream.api.stream.KeyedPartitionStream<NEW_KEY,V>
    keyBy(org.apache.flink.api.java.functions.KeySelector<V,NEW_KEY> keySelector)
     
    <OUT> org.apache.flink.datastream.api.stream.NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT>
    process(org.apache.flink.datastream.api.function.OneInputStreamProcessFunction<V,OUT> processFunction)
     
    <OUT> org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndKeyedPartitionStream<K,OUT>
    process(org.apache.flink.datastream.api.function.OneInputStreamProcessFunction<V,OUT> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT,K> newKeySelector)
     
    <OUT1, OUT2>
    org.apache.flink.datastream.api.stream.NonKeyedPartitionStream.ProcessConfigurableAndTwoNonKeyedPartitionStream<OUT1,OUT2>
    process(org.apache.flink.datastream.api.function.TwoOutputStreamProcessFunction<V,OUT1,OUT2> processFunction)
     
    <OUT1, OUT2>
    org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndTwoKeyedPartitionStreams<K,OUT1,OUT2>
    process(org.apache.flink.datastream.api.function.TwoOutputStreamProcessFunction<V,OUT1,OUT2> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT1,K> keySelector1, org.apache.flink.api.java.functions.KeySelector<OUT2,K> keySelector2)
     
    org.apache.flink.datastream.api.stream.NonKeyedPartitionStream<V>
     
    org.apache.flink.datastream.api.stream.ProcessConfigurable<?>
    toSink(org.apache.flink.api.connector.dsv2.Sink<V> sink)
     

    Methods inherited from class org.apache.flink.datastream.impl.stream.AbstractDataStream

    getEnvironment, getSideOutputTransform, getTransformation, getType

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KeyedPartitionStreamImpl

      public KeyedPartitionStreamImpl(AbstractDataStream<V> dataStream, org.apache.flink.api.java.functions.KeySelector<V,K> keySelector)
    • KeyedPartitionStreamImpl

      public KeyedPartitionStreamImpl(AbstractDataStream<V> dataStream, org.apache.flink.api.java.functions.KeySelector<V,K> keySelector, org.apache.flink.api.common.typeinfo.TypeInformation<K> keyType)
    • KeyedPartitionStreamImpl

      public KeyedPartitionStreamImpl(AbstractDataStream<V> dataStream, org.apache.flink.api.dag.Transformation<V> partitionTransformation, org.apache.flink.api.java.functions.KeySelector<V,K> keySelector, org.apache.flink.api.common.typeinfo.TypeInformation<K> keyType)
      This can construct a keyed stream directly without partitionTransformation to avoid shuffle.
  • Method Details

    • process

      public <OUT> org.apache.flink.datastream.api.stream.NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT> process(org.apache.flink.datastream.api.function.OneInputStreamProcessFunction<V,OUT> processFunction)
      Specified by:
      process in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • process

      public <OUT> org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndKeyedPartitionStream<K,OUT> process(org.apache.flink.datastream.api.function.OneInputStreamProcessFunction<V,OUT> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT,K> newKeySelector)
      Specified by:
      process in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • process

      public <OUT1, OUT2> org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndTwoKeyedPartitionStreams<K,OUT1,OUT2> process(org.apache.flink.datastream.api.function.TwoOutputStreamProcessFunction<V,OUT1,OUT2> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT1,K> keySelector1, org.apache.flink.api.java.functions.KeySelector<OUT2,K> keySelector2)
      Specified by:
      process in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • process

      public <OUT1, OUT2> org.apache.flink.datastream.api.stream.NonKeyedPartitionStream.ProcessConfigurableAndTwoNonKeyedPartitionStream<OUT1,OUT2> process(org.apache.flink.datastream.api.function.TwoOutputStreamProcessFunction<V,OUT1,OUT2> processFunction)
      Specified by:
      process in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • connectAndProcess

      public <T_OTHER, OUT> org.apache.flink.datastream.api.stream.NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT> connectAndProcess(org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputNonBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction)
      Specified by:
      connectAndProcess in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • connectAndProcess

      public <T_OTHER, OUT> org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndKeyedPartitionStream<K,OUT> connectAndProcess(org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputNonBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT,K> newKeySelector)
      Specified by:
      connectAndProcess in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • connectAndProcess

      public <T_OTHER, OUT> org.apache.flink.datastream.api.stream.NonKeyedPartitionStream.ProcessConfigurableAndNonKeyedPartitionStream<OUT> connectAndProcess(org.apache.flink.datastream.api.stream.BroadcastStream<T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction)
      Specified by:
      connectAndProcess in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • connectAndProcess

      public <T_OTHER, OUT> org.apache.flink.datastream.api.stream.KeyedPartitionStream.ProcessConfigurableAndKeyedPartitionStream<K,OUT> connectAndProcess(org.apache.flink.datastream.api.stream.BroadcastStream<T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction, org.apache.flink.api.java.functions.KeySelector<OUT,K> newKeySelector)
      Specified by:
      connectAndProcess in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • getJoinTransformation

      public <T_OTHER, OUT> org.apache.flink.api.dag.Transformation<OUT> getJoinTransformation(org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,T_OTHER> other, org.apache.flink.datastream.api.function.TwoInputNonBroadcastStreamProcessFunction<V,T_OTHER,OUT> processFunction, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo)
    • getKeyType

      public org.apache.flink.api.common.typeinfo.TypeInformation<K> getKeyType()
    • getKeySelector

      public org.apache.flink.api.java.functions.KeySelector<V,K> getKeySelector()
    • toSink

      public org.apache.flink.datastream.api.stream.ProcessConfigurable<?> toSink(org.apache.flink.api.connector.dsv2.Sink<V> sink)
      Specified by:
      toSink in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • global

      public org.apache.flink.datastream.api.stream.GlobalStream<V> global()
      Specified by:
      global in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • keyBy

      public <NEW_KEY> org.apache.flink.datastream.api.stream.KeyedPartitionStream<NEW_KEY,V> keyBy(org.apache.flink.api.java.functions.KeySelector<V,NEW_KEY> keySelector)
      Specified by:
      keyBy in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • shuffle

      public org.apache.flink.datastream.api.stream.NonKeyedPartitionStream<V> shuffle()
      Specified by:
      shuffle in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>
    • broadcast

      public org.apache.flink.datastream.api.stream.BroadcastStream<V> broadcast()
      Specified by:
      broadcast in interface org.apache.flink.datastream.api.stream.KeyedPartitionStream<K,V>