You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by 赢峰 <si...@163.com> on 2021/03/15 14:01:28 UTC

Flink shuffle vs rebalance


Flink 中 shuffle Partitioner 和 rebalance partitoner 有什么区别?






Re: Flink shuffle vs rebalance

Posted by Kezhu Wang <ke...@gmail.com>.
ShufflePartitioner:

      public int selectChannel(SerializationDelegate<StreamRecord<T>>
record) {
          return random.nextInt(numberOfChannels);
      }

RebalancePartitioner
     public int selectChannel(SerializationDelegate<StreamRecord<T>>
record) {
          nextChannelToSendTo = (nextChannelToSendTo + 1) %
numberOfChannels;
          return nextChannelToSendTo;
     }


一个随机,一个严格 round-robin。


Best,
Kezhu Wang

On March 15, 2021 at 22:02:33, 赢峰 (si_ji_feng@163.com) wrote:



Flink 中 shuffle Partitioner 和 rebalance partitoner 有什么区别?