pnowojski 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_r335991410
 
 

 ##########
 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:
   > My above proposal might not effect this behavior
   
   ops, thanks for pointing this and rephrasing your idea.
   
   > I approve this way and it has the same effect as the listener way I 
mentioned before.
   
   Yes, now I think I get your idea. So in short, we also need to either:
   
   1. add `Future<?> NetworkBufferPool#isAvailable()` method
   2. add listeners/callbacks to the `NetworkBufferPool`
   
   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.
   
   > ATM the backpressure mechanism still works 
   
   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.

----------------------------------------------------------------
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