Class NetworkBufferPool

    • Constructor Detail

      • NetworkBufferPool

        @VisibleForTesting
        public NetworkBufferPool​(int numberOfSegmentsToAllocate,
                                 int segmentSize)
      • NetworkBufferPool

        public NetworkBufferPool​(int numberOfSegmentsToAllocate,
                                 int segmentSize,
                                 Duration requestSegmentsTimeout)
        Allocates all MemorySegment instances managed by this pool.
    • Method Detail

      • destroy

        public void destroy()
      • isDestroyed

        public boolean isDestroyed()
      • getTotalNumberOfMemorySegments

        public int getTotalNumberOfMemorySegments()
      • getTotalMemory

        public long getTotalMemory()
      • getNumberOfAvailableMemorySegments

        public int getNumberOfAvailableMemorySegments()
      • getAvailableMemory

        public long getAvailableMemory()
      • getNumberOfUsedMemorySegments

        public int getNumberOfUsedMemorySegments()
      • getUsedMemory

        public long getUsedMemory()
      • getNumberOfRegisteredBufferPools

        public int getNumberOfRegisteredBufferPools()
      • getEstimatedNumberOfRequestedMemorySegments

        public long getEstimatedNumberOfRequestedMemorySegments()
      • getEstimatedRequestedMemory

        public long getEstimatedRequestedMemory()
      • getEstimatedRequestedSegmentsUsage

        public int getEstimatedRequestedSegmentsUsage()
      • maybeLogUsageWarning

        public void maybeLogUsageWarning()
      • countBuffers

        public int countBuffers()
      • getAvailableFuture

        public CompletableFuture<?> getAvailableFuture()
        Returns a future that is completed when there are free segments in this pool.
        Specified by:
        getAvailableFuture in interface AvailabilityProvider
        Returns:
        a future that is completed if the respective provider is available.
      • createBufferPool

        public BufferPool createBufferPool​(int numRequiredBuffers,
                                           int maxUsedBuffers)
                                    throws IOException
        Description copied from interface: BufferPoolFactory
        Tries to create a buffer pool, which is guaranteed to provide at least the number of required buffers.

        The buffer pool is of dynamic size with at least numRequiredBuffers buffers.

        Specified by:
        createBufferPool in interface BufferPoolFactory
        Parameters:
        numRequiredBuffers - minimum number of network buffers in this pool
        maxUsedBuffers - maximum number of network buffers this pool offers
        Throws:
        IOException
      • createBufferPool

        public BufferPool createBufferPool​(int numRequiredBuffers,
                                           int maxUsedBuffers,
                                           int numSubpartitions,
                                           int maxBuffersPerChannel,
                                           int maxOverdraftBuffersPerGate)
                                    throws IOException
        Description copied from interface: BufferPoolFactory
        Tries to create a buffer pool with an owner, which is guaranteed to provide at least the number of required buffers.

        The buffer pool is of dynamic size with at least numRequiredBuffers buffers.

        Specified by:
        createBufferPool in interface BufferPoolFactory
        Parameters:
        numRequiredBuffers - minimum number of network buffers in this pool
        maxUsedBuffers - maximum number of network buffers this pool offers
        numSubpartitions - number of subpartitions in this pool
        maxBuffersPerChannel - maximum number of buffers to use for each channel
        maxOverdraftBuffersPerGate - maximum number of overdraft buffers to use for each gate
        Throws:
        IOException
      • destroyAllBufferPools

        public void destroyAllBufferPools()
        Destroys all buffer pools that allocate their buffers from this buffer pool (created via createBufferPool(int, int)).