public class BufferManager extends Object implements BufferListener, BufferRecycler
InputChannel
to request/recycle exclusive or floating
buffers.BufferListener.NotificationResult
Constructor and Description |
---|
BufferManager(MemorySegmentProvider globalPool,
InputChannel inputChannel,
int numRequiredBuffers) |
Modifier and Type | Method and Description |
---|---|
BufferListener.NotificationResult |
notifyBufferAvailable(Buffer buffer)
The buffer pool notifies this listener of an available floating buffer.
|
void |
notifyBufferDestroyed()
Notification callback if the buffer provider is destroyed.
|
void |
recycle(MemorySegment segment)
Exclusive buffer is recycled to this channel manager directly and it may trigger return extra
floating buffer based on numRequiredBuffers.
|
public BufferManager(MemorySegmentProvider globalPool, InputChannel inputChannel, int numRequiredBuffers)
public void recycle(MemorySegment segment)
recycle
in interface BufferRecycler
segment
- The exclusive segment of this channel.public BufferListener.NotificationResult notifyBufferAvailable(Buffer buffer)
notifyBufferAvailable
in interface BufferListener
buffer
- Buffer that becomes available in buffer pool.public void notifyBufferDestroyed()
BufferListener
notifyBufferDestroyed
in interface BufferListener
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.