pnowojski commented on a change in pull request #18392:
URL: https://github.com/apache/flink/pull/18392#discussion_r790759181
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/NetworkBufferPool.java
##########
@@ -356,6 +362,76 @@ public int getNumberOfRegisteredBufferPools() {
}
}
+ public long getNumberOfRequestedMemorySegments() {
+ long requestedSegments = 0;
+ synchronized (factoryLock) {
+ for (LocalBufferPool bufferPool : allBufferPools) {
+ int maxNumberOfMemorySegments =
bufferPool.getMaxNumberOfMemorySegments();
+ /**
+ * As defined in {@link
+ *
org.apache.flink.runtime.shuffle.NettyShuffleUtils#getMinMaxNetworkBuffersPerResultPartition(int,
+ * int, int, int, int,
+ *
org.apache.flink.runtime.io.network.partition.ResultPartitionType)}. Unbounded
+ * subpartitions have {@link maxNumberOfMemorySegments} set to
{@code
+ * Integer.MAX_VALUE}. In this case let's use number of
required segments instead.
+ */
+ if (maxNumberOfMemorySegments < Integer.MAX_VALUE) {
Review comment:
Done. Can you check the fixup commit?
--
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]