Package io.netty.channel.uring
Class IoUringFixedBufferRingAllocator
- java.lang.Object
-
- io.netty.channel.uring.IoUringFixedBufferRingAllocator
-
- All Implemented Interfaces:
IoUringBufferRingAllocator
public final class IoUringFixedBufferRingAllocator extends java.lang.Object implements IoUringBufferRingAllocator
IoUringBufferRingAllocator
implementation which uses a fixed size for the buffers that are returned byallocate()
.
-
-
Constructor Summary
Constructors Constructor Description IoUringFixedBufferRingAllocator(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 ByteBuf
allocate()
Creates a new receive buffer to use by the buffer ring.void
lastBytesRead(int attempted, int actual)
Set the bytes that have been read for the last read operation that was full-filled out of the buffer ring.
-
-
-
Constructor Detail
-
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
-
allocate
public ByteBuf allocate()
Description copied from interface:IoUringBufferRingAllocator
Creates a new receive buffer to use by the buffer ring. The returnedByteBuf
must be direct.- Specified by:
allocate
in interfaceIoUringBufferRingAllocator
-
lastBytesRead
public void lastBytesRead(int attempted, int actual)
Description copied from interface:IoUringBufferRingAllocator
Set the bytes that have been read for the last read operation that was full-filled out of the buffer ring.- Specified by:
lastBytesRead
in interfaceIoUringBufferRingAllocator
- Parameters:
attempted
- the attempted bytes to read.actual
- the number of bytes that could be read.
-
-