Interface BufferPool
- All Superinterfaces:
AvailabilityProvider,BufferProvider,BufferRecycler
- All Known Implementing Classes:
LocalBufferPool
A dynamically sized buffer pool.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.AvailabilityProvider
AvailabilityProvider.AvailabilityHelperNested 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
Modifier and TypeMethodDescriptionintReturns the number of used buffers of this buffer pool.intReturns the maximum number of memory segments this buffer pool should use.intReturns the max overdraft buffer size of per gate.intReturns the number memory segments, which are currently held by this buffer pool.intReturns the number of guaranteed (minimum number of) memory segments of this buffer pool.intReturns the current size of this buffer pool.booleanChecks whether this buffer pool has been destroyed.voidDestroys 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, isAvailableMethods inherited from interface org.apache.flink.runtime.io.network.buffer.BufferProvider
addBufferListener, requestBuffer, requestBufferBuilder, requestBufferBuilder, requestBufferBuilderBlocking, requestBufferBuilderBlocking, requestMemorySegment, requestMemorySegmentBlockingMethods inherited from interface org.apache.flink.runtime.io.network.buffer.BufferRecycler
recycle
-
Method Details
-
reserveSegments
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:
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.
-