zhijiangW commented on a change in pull request #9905: [FLINK-14396][network] 
Implement rudimentary non-blocking network output
URL: https://github.com/apache/flink/pull/9905#discussion_r336027531
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java
 ##########
 @@ -299,6 +313,15 @@ private NotificationResult 
fireBufferAvailableNotification(BufferListener listen
                return notificationResult;
        }
 
+       /**
+        * @return true if there is no available buffers in queue and the 
global quota is also exhausted.
+        */
+       private boolean isUnavailable() {
+               assert Thread.holdsLock(availableMemorySegments);
+
+               return availableMemorySegments.isEmpty() && 
numberOfRequestedMemorySegments == currentPoolSize;
 
 Review comment:
   > I would be in favour of the first option, for the sake of consistency and 
easier integration with rest of the stack, but if you have opposite preference 
we can try it out.
   
   Actually I had no preference before, and the second way was taken in 
`RemoteInputChannel` requesting floating buffers from `LocalInputChannel`. I am 
willing to take the first way now because it is widely used recently and seems 
more unified with other stacks.
   
   > Yes. I would still consider this NetworkBufferPool notifications/future as 
a required part of this jira ticket. I would slightly prefer to do it as two 
commits in the same PR, but we can split it as well.
   
   Agree, it can be regarded as the scope of this PR because it also solves 
another issue of non-blocking output. :)

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to