public final class GlobalBufferPool extends Object
All buffers used by the network stack come from this pool. Requests to this pool are mediated by instances of
LocalBufferPool.
The size and number of buffers can be configured via the global system config.
| Constructor and Description |
|---|
GlobalBufferPool(int numBuffers,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
int |
getBufferSize()
Returns the size of buffers (in bytes).
|
int |
numAvailableBuffers()
Returns the number of currently available buffers.
|
int |
numBuffers()
Returns the total number of managed buffers.
|
MemorySegment |
requestBuffer()
Requests a buffer from the pool.
|
void |
returnBuffer(MemorySegment buffer)
Returns a buffer to the pool.
|
public MemorySegment requestBuffer()
null, if no buffer availablepublic void returnBuffer(MemorySegment buffer)
buffer - the buffer to be returnedpublic int getBufferSize()
public int numBuffers()
public int numAvailableBuffers()
public void destroy()
Copyright © 2014 The Apache Software Foundation. All rights reserved.