zhijiangW commented on a change in pull request #7051: [FLINK-10820][network] Simplify the RebalancePartitioner implementation URL: https://github.com/apache/flink/pull/7051#discussion_r233862113
########## File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/partitioner/RebalancePartitioner.java ########## @@ -33,29 +33,18 @@ public class RebalancePartitioner<T> extends StreamPartitioner<T> { private static final long serialVersionUID = 1L; - private final int[] returnArray = {Integer.MAX_VALUE - 1}; + private final int[] returnArray = { -1 }; Review comment: Yes, the `numChannels` always coms form the RecordWriter's final field, so we can call `ChannelSelector#setup(int numChannels)` then. I think we are on the same page for the following: 1. It is no need to retain `numChannels` in the `selectChannels` method. 2. No need to introduce another boolean to check initialized state in `selectChannels` process. They are just what I thought before, and glad to see you also think so. :) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services