pnowojski commented on a change in pull request #18173:
URL: https://github.com/apache/flink/pull/18173#discussion_r776622362



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/NetworkBufferPool.java
##########
@@ -158,7 +159,8 @@ public MemorySegment requestMemorySegment() {
 
     public List<MemorySegment> requestMemorySegmentsBlocking(int 
numberOfSegmentsToRequest)
             throws IOException {
-        return internalRequestMemorySegments(numberOfSegmentsToRequest);
+        return internalRequestMemorySegments(
+                numberOfSegmentsToRequest, 
this::internalRecycleMemorySegments);

Review comment:
       Maybe lets rename `requestMemorySegments` to something like 
`requestUnpooledMemorySegments()` (but please do so as a separate commit - can 
be in this PR), with the following java doc:
   ```
   Unpooled memory segments are requested directly from {@link 
NetworkBufferPool}, as opposed to pooled 
   segments, that are requested through {@link BufferPool} that was created 
from this {@link NetworkBufferPool}
   (see {@link NetworkBufferPool#createBufferPool(...)}). They are used for 
example for exclusive 
   {@link RemoteInputChannel} credits, that are permanently assigned to that 
channel, and never returned to
   any {@link BufferPool}. As opposed to pooled segments, when requested, 
unpooled segments needs to be accounted against {@link 
#numTotalRequiredBuffers}, which might require redistribution of the segments.
   ```
   + renaming other methods by adding "pooled" suffixes?
   
   I don't like that "unpooled" is ambiguous, because we have two levels of 
pooling, but I don't know how to express it differently. Or do you have some 
better proposal?




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to