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 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
getMaxOverdraftBuffersPerGate()
Returns the max overdraft buffer size of per gate.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
reserveSegments(int numberOfSegmentsToReserve)
Reserves the target number of segments to this pool.void
setMaxOverdraftBuffersPerGate(int maxOverdraftBuffersPerGate)
Sets the max overdraft buffer size of per gate.void
setNumBuffers(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 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 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.
-
-