public class BufferManager extends Object implements BufferListener, BufferRecycler
InputChannel
to request/recycle exclusive or floating
buffers.
The exclusive buffers are either entirely allocated from the local buffer pool, or they are
all allocated from the global pool. When allocated from the local buffer pool, the variable
globalPool
is null.
BufferRecycler.DummyBufferRecycler
Constructor and Description |
---|
BufferManager(InputChannel inputChannel,
int initialCredit) |
BufferManager(MemorySegmentProvider globalPool,
InputChannel inputChannel,
int initialCredit) |
Modifier and Type | Method and Description |
---|---|
boolean |
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(InputChannel inputChannel, int initialCredit)
public BufferManager(@Nullable MemorySegmentProvider globalPool, InputChannel inputChannel, int initialCredit)
public void recycle(MemorySegment segment)
recycle
in interface BufferRecycler
segment
- The exclusive segment of this channel.public boolean 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–2024 The Apache Software Foundation. All rights reserved.