zhijiangW commented on a change in pull request #11155: [FLINK-14818][benchmark] Fix receiving InputGate setup of StreamNetworkBenchmarkEnvironment. URL: https://github.com/apache/flink/pull/11155#discussion_r382394298
########## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/benchmark/StreamNetworkBenchmarkEnvironment.java ########## @@ -238,18 +252,19 @@ private InputGate createInputGate(TaskManagerLocation senderLocation) throws Exc private InputGateDeploymentDescriptor createInputGateDeploymentDescriptor( TaskManagerLocation senderLocation, - int consumedSubpartitionIndex, + int gateIndex, ResourceID localLocation) { - final ShuffleDescriptor[] channelDescriptors = Arrays.stream(partitionIds) - .map(partitionId -> - createShuffleDescriptor(localMode, partitionId, localLocation, senderLocation, consumedSubpartitionIndex)) - .toArray(ShuffleDescriptor[]::new); + final ShuffleDescriptor[] channelDescriptors = new ShuffleDescriptor[channels]; + for (int channelIndex = 0; channelIndex < channels; ++channelIndex) { + channelDescriptors[channelIndex] = createShuffleDescriptor( + localMode, partitionIds[gateIndex], localLocation, senderLocation, channelIndex); Review comment: I am a bit torn for the `connectionIndex` value. If we use `channelIndex` as the value, it would create 1000 connections in theory if there are 1000 subpartitions in writer. I a bit prefer to use `gateIndex` instead to create less connections. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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