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
IoUringBufferRingAllocatorimplementation 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 intnextBufferSize()Return the next buffer size of eachByteBufthat 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- 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
public IoUringFixedBufferRingAllocator(ByteBufAllocator allocator, int bufferSize)
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 Detail
-
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.
-
-