lometheus commented on a change in pull request #17024:
URL: https://github.com/apache/flink/pull/17024#discussion_r700666840
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BufferWritingResultPartition.java
##########
@@ -330,8 +330,16 @@ private BufferBuilder
appendBroadcastDataForRecordContinuation(
private void createBroadcastBufferConsumers(BufferBuilder buffer, int
partialRecordBytes)
throws IOException {
try (final BufferConsumer consumer =
buffer.createBufferConsumerFromBeginning()) {
+ int desirableBufferSize = Integer.MAX_VALUE;
for (ResultSubpartition subpartition : subpartitions) {
- subpartition.add(consumer.copy(), partialRecordBytes);
+ int subPartitionBufferSize = subpartition.add(consumer.copy(),
partialRecordBytes);
+ desirableBufferSize =
+ subPartitionBufferSize > 0
+ ? Math.min(desirableBufferSize,
subPartitionBufferSize)
+ : desirableBufferSize;
+ }
+ if (desirableBufferSize != Integer.MAX_VALUE) {
Review comment:
You are correct, the code should be as concise as possible,I drop this
condition.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]