Package io.netty.channel.uring
Class IoUringFixedBufferRingAllocator
- java.lang.Object
-
- io.netty.channel.uring.AbstractIoUringBufferRingAllocator
-
- io.netty.channel.uring.IoUringFixedBufferRingAllocator
-
- All Implemented Interfaces:
IoUringBufferRingAllocator
public final class IoUringFixedBufferRingAllocator extends AbstractIoUringBufferRingAllocator
IoUringBufferRingAllocator
implementation which uses a fixed size for the buffers that are returned byAbstractIoUringBufferRingAllocator.allocate()
.
-
-
Constructor Summary
Constructors Constructor Description IoUringFixedBufferRingAllocator(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
nextBufferSize()
Return the next buffer size of eachByteBuf
that is put into the buffer ring.-
Methods inherited from class io.netty.channel.uring.AbstractIoUringBufferRingAllocator
allocate, allocateBatch, lastBytesRead
-
-
-
-
Constructor Detail
-
IoUringFixedBufferRingAllocator
public IoUringFixedBufferRingAllocator(ByteBufAllocator allocator, boolean largeAllocation, int bufferSize)
Create a new instance- Parameters:
allocator
- theByteBufAllocator
to use.largeAllocation
-true
if we should do a large allocation for the whole buffer ring and then slice out the buffers orfalse
if we should do one allocation per buffer.bufferSize
- the size of the buffers that are allocated.
-
IoUringFixedBufferRingAllocator
public IoUringFixedBufferRingAllocator(ByteBufAllocator allocator, int bufferSize)
Create a new instance- Parameters:
allocator
- theByteBufAllocator
to 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 Detail
-
nextBufferSize
protected int nextBufferSize()
Description copied from class:AbstractIoUringBufferRingAllocator
Return the next buffer size of eachByteBuf
that is put into the buffer ring.- Specified by:
nextBufferSize
in classAbstractIoUringBufferRingAllocator
- Returns:
- the next size.
-
-