public interface BufferPool extends BufferProvider, BufferRecycler
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfAvailableMemorySegments()
Returns the number memory segments, which are currently held by this buffer pool.
|
int |
getNumberOfRequiredMemorySegments()
Returns the number of guaranteed (minimum number of) memory segments of this buffer pool.
|
int |
getNumBuffers()
Returns the current size of this buffer pool.
|
boolean |
isDestroyed()
Checks whether this buffer pool has been destroyed.
|
void |
lazyDestroy()
Destroys this buffer pool.
|
void |
setBufferPoolOwner(BufferPoolOwner owner)
The owner of this buffer pool to be called when memory needs to be released to avoid back
pressure.
|
void |
setNumBuffers(int numBuffers)
Sets the current size of this buffer pool.
|
addListener, getMemorySegmentSize, requestBuffer, requestBufferBlocking
recycle
void setBufferPoolOwner(BufferPoolOwner owner)
void lazyDestroy()
If not all buffers are available, they are recycled lazily as soon as they are recycled.
boolean isDestroyed()
isDestroyed
in interface BufferProvider
int getNumberOfRequiredMemorySegments()
int getNumBuffers()
The size of the buffer pool can change dynamically at runtime.
void setNumBuffers(int numBuffers) throws IOException
The size needs to be greater or equals to the guaranteed number of memory segments.
IOException
int getNumberOfAvailableMemorySegments()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.