Interface BufferPool
-
- All Superinterfaces:
AvailabilityProvider,BufferProvider,BufferRecycler
- All Known Implementing Classes:
LocalBufferPool
public interface BufferPool extends BufferProvider, BufferRecycler
A dynamically sized buffer pool.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.AvailabilityProvider
AvailabilityProvider.AvailabilityHelper
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.network.buffer.BufferRecycler
BufferRecycler.DummyBufferRecycler
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.runtime.io.AvailabilityProvider
AVAILABLE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intbestEffortGetNumOfUsedBuffers()Returns the number of used buffers of this buffer pool.intgetMaxNumberOfMemorySegments()Returns the maximum number of memory segments this buffer pool should use.intgetMaxOverdraftBuffersPerGate()Returns the max overdraft buffer size of per gate.intgetNumberOfAvailableMemorySegments()Returns the number memory segments, which are currently held by this buffer pool.intgetNumberOfRequiredMemorySegments()Returns the number of guaranteed (minimum number of) memory segments of this buffer pool.intgetNumBuffers()Returns the current size of this buffer pool.booleanisDestroyed()Checks whether this buffer pool has been destroyed.voidlazyDestroy()Destroys this buffer pool.voidreserveSegments(int numberOfSegmentsToReserve)Reserves the target number of segments to this pool.voidsetMaxOverdraftBuffersPerGate(int maxOverdraftBuffersPerGate)Sets the max overdraft buffer size of per gate.voidsetNumBuffers(int numBuffers)Sets the current size of this buffer pool.-
Methods inherited from interface org.apache.flink.runtime.io.AvailabilityProvider
getAvailableFuture, isApproximatelyAvailable, isAvailable
-
Methods inherited from interface org.apache.flink.runtime.io.network.buffer.BufferProvider
addBufferListener, requestBuffer, requestBufferBuilder, requestBufferBuilder, requestBufferBuilderBlocking, requestBufferBuilderBlocking, requestMemorySegment, requestMemorySegmentBlocking
-
Methods inherited from interface org.apache.flink.runtime.io.network.buffer.BufferRecycler
recycle
-
-
-
-
Method Detail
-
reserveSegments
void reserveSegments(int numberOfSegmentsToReserve) throws IOExceptionReserves 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:
isDestroyedin interfaceBufferProvider
-
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.
-
-