Class BufferManager
java.lang.Object
org.apache.flink.runtime.io.network.partition.consumer.BufferManager
- All Implemented Interfaces:
BufferListener,BufferRecycler
The general buffer manager used by
InputChannel to request/recycle exclusive or floating
buffers.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.network.buffer.BufferRecycler
BufferRecycler.DummyBufferRecycler -
Constructor Summary
ConstructorsConstructorDescriptionBufferManager(org.apache.flink.core.memory.MemorySegmentProvider globalPool, InputChannel inputChannel, int numRequiredBuffers) -
Method Summary
Modifier and TypeMethodDescriptionbooleannotifyBufferAvailable(Buffer buffer) The buffer pool notifies this listener of an available floating buffer.voidNotification callback if the buffer provider is destroyed.voidrecycle(org.apache.flink.core.memory.MemorySegment segment) Exclusive buffer is recycled to this channel manager directly and it may trigger return extra floating buffer based on numRequiredBuffers.
-
Constructor Details
-
BufferManager
public BufferManager(org.apache.flink.core.memory.MemorySegmentProvider globalPool, InputChannel inputChannel, int numRequiredBuffers)
-
-
Method Details
-
recycle
public void recycle(org.apache.flink.core.memory.MemorySegment segment) Exclusive buffer is recycled to this channel manager directly and it may trigger return extra floating buffer based on numRequiredBuffers.- Specified by:
recyclein interfaceBufferRecycler- Parameters:
segment- The exclusive segment of this channel.
-
notifyBufferAvailable
The buffer pool notifies this listener of an available floating buffer. If the listener is released or currently does not need extra buffers, the buffer should be returned to the buffer pool. Otherwise, the buffer will be added into the bufferQueue.- Specified by:
notifyBufferAvailablein interfaceBufferListener- Parameters:
buffer- Buffer that becomes available in buffer pool.- Returns:
- true if the buffer is accepted by this listener.
-
notifyBufferDestroyed
public void notifyBufferDestroyed()Description copied from interface:BufferListenerNotification callback if the buffer provider is destroyed.- Specified by:
notifyBufferDestroyedin interfaceBufferListener
-