public interface BufferPool extends BufferProvider, BufferRecycler
AvailabilityProvider.AvailabilityHelper
AVAILABLE
Modifier and Type | Method and Description |
---|---|
int |
bestEffortGetNumOfUsedBuffers()
Returns the number of used buffers of this buffer pool.
|
int |
getMaxNumberOfMemorySegments()
Returns the maximum number of memory segments this buffer pool should use.
|
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 |
setNumBuffers(int numBuffers)
Sets the current size of this buffer pool.
|
addBufferListener, requestBuffer, requestBufferBuilderBlocking
getAvailableFuture, isApproximatelyAvailable, isAvailable
recycle
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 getMaxNumberOfMemorySegments()
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 equal to the guaranteed number of memory segments.
IOException
int getNumberOfAvailableMemorySegments()
int bestEffortGetNumOfUsedBuffers()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.