Interface BufferPool

All Superinterfaces:
AvailabilityProvider, BufferProvider, BufferRecycler
All Known Implementing Classes:
LocalBufferPool

public interface BufferPool extends BufferProvider, BufferRecycler
A dynamically sized buffer pool.
  • Method Details

    • reserveSegments

      void reserveSegments(int numberOfSegmentsToReserve) throws IOException
      Reserves the target number of segments to this pool. Will throw an exception if it can not allocate enough segments.
      Throws:
      IOException
    • lazyDestroy

      void lazyDestroy()
      Destroys this buffer pool.

      If not all buffers are available, they are recycled lazily as soon as they are recycled.

    • isDestroyed

      boolean isDestroyed()
      Checks whether this buffer pool has been destroyed.
      Specified by:
      isDestroyed in interface BufferProvider
    • getNumberOfRequiredMemorySegments

      int getNumberOfRequiredMemorySegments()
      Returns the number of guaranteed (minimum number of) memory segments of this buffer pool.
    • getMaxNumberOfMemorySegments

      int getMaxNumberOfMemorySegments()
      Returns the maximum number of memory segments this buffer pool should use.
      Returns:
      maximum number of memory segments to use or -1 if unlimited
    • getNumBuffers

      int getNumBuffers()
      Returns the current size of this buffer pool.

      The size of the buffer pool can change dynamically at runtime.

    • setNumBuffers

      void setNumBuffers(int numBuffers)
      Sets the current size of this buffer pool.

      The size needs to be greater or equal to the guaranteed number of memory segments.

    • setMaxOverdraftBuffersPerGate

      void setMaxOverdraftBuffersPerGate(int maxOverdraftBuffersPerGate)
      Sets the max overdraft buffer size of per gate.
    • getMaxOverdraftBuffersPerGate

      int getMaxOverdraftBuffersPerGate()
      Returns the max overdraft buffer size of per gate.
    • getNumberOfAvailableMemorySegments

      int getNumberOfAvailableMemorySegments()
      Returns the number memory segments, which are currently held by this buffer pool.
    • bestEffortGetNumOfUsedBuffers

      int bestEffortGetNumOfUsedBuffers()
      Returns the number of used buffers of this buffer pool.