Class IoUringFixedBufferRingAllocator
java.lang.Object
io.netty.channel.uring.AbstractIoUringBufferRingAllocator
io.netty.channel.uring.IoUringFixedBufferRingAllocator
- All Implemented Interfaces:
IoUringBufferRingAllocator
IoUringBufferRingAllocator implementation which uses a fixed size for the buffers that are returned by
AbstractIoUringBufferRingAllocator.allocate().-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIoUringFixedBufferRingAllocator(int bufferSize) Create a new instanceIoUringFixedBufferRingAllocator(ByteBufAllocator allocator, boolean largeAllocation, int bufferSize) Create a new instanceIoUringFixedBufferRingAllocator(ByteBufAllocator allocator, int bufferSize) Create a new instance -
Method Summary
Modifier and TypeMethodDescriptionprotected intReturn the next buffer size of eachByteBufthat is put into the buffer ring.Methods inherited from class AbstractIoUringBufferRingAllocator
allocate, allocateBatch, lastBytesReadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
bufferSize
private final int bufferSize
-
-
Constructor Details
-
IoUringFixedBufferRingAllocator
public IoUringFixedBufferRingAllocator(ByteBufAllocator allocator, boolean largeAllocation, int bufferSize) Create a new instance- Parameters:
allocator- theByteBufAllocatorto use.largeAllocation-trueif we should do a large allocation for the whole buffer ring and then slice out the buffers orfalseif we should do one allocation per buffer.bufferSize- the size of the buffers that are allocated.
-
IoUringFixedBufferRingAllocator
Create a new instance- Parameters:
allocator- theByteBufAllocatorto use.bufferSize- the size of the buffers that are allocated.
-
IoUringFixedBufferRingAllocator
public IoUringFixedBufferRingAllocator(int bufferSize) Create a new instance- Parameters:
bufferSize- the size of the buffers that are allocated.
-
-
Method Details
-
nextBufferSize
protected int nextBufferSize()Description copied from class:AbstractIoUringBufferRingAllocatorReturn the next buffer size of eachByteBufthat is put into the buffer ring.- Specified by:
nextBufferSizein classAbstractIoUringBufferRingAllocator- Returns:
- the next size.
-