zhijiangW commented on a change in pull request #9993: 
[FLINK-14498][runtime]Introduce NetworkBufferPool#isAvailable() for interacting 
with LocalBufferPool.
URL: https://github.com/apache/flink/pull/9993#discussion_r340447130
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/NetworkBufferPool.java
 ##########
 @@ -54,15 +57,16 @@
  * the buffers for the network data transfer. When new local buffer pools are 
created, the
  * NetworkBufferPool dynamically redistributes the buffers between the pools.
  */
-public class NetworkBufferPool implements BufferPoolFactory, 
MemorySegmentProvider {
+public class NetworkBufferPool implements BufferPoolFactory, 
MemorySegmentProvider, AvailabilityProvider {
 
        private static final Logger LOG = 
LoggerFactory.getLogger(NetworkBufferPool.class);
 
        private final int totalNumberOfMemorySegments;
 
        private final int memorySegmentSize;
 
-       private final ArrayBlockingQueue<MemorySegment> availableMemorySegments;
+       @GuardedBy("availabilityHelper")
+       private final ArrayDeque<MemorySegment> availableMemorySegments;
 
 Review comment:
   Another option is synchronizing the `availableMemorySegments` directly 
instead of `availabilityHelper`, then we could remove the 
`@GuardedBy("availabilityHelper")`

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to