public interface BufferPool extends BufferProvider, BufferRecycler
AvailabilityProvider.AvailabilityHelper
BufferRecycler.DummyBufferRecycler
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, requestBufferBuilder, requestBufferBuilder, requestBufferBuilderBlocking, requestBufferBuilderBlocking, requestMemorySegment, requestMemorySegmentBlocking
and, getAvailableFuture, isApproximatelyAvailable, isAvailable, or
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)
The size needs to be greater or equal to the guaranteed number of memory segments.
int getNumberOfAvailableMemorySegments()
int bestEffortGetNumOfUsedBuffers()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.