Package io.netty.channel.uring
Class IoUringFixedBufferRingAllocator
- java.lang.Object
-
- io.netty.channel.uring.IoUringFixedBufferRingAllocator
-
- All Implemented Interfaces:
IoUringBufferRingAllocator
public final class IoUringFixedBufferRingAllocator extends Object implements IoUringBufferRingAllocator
IoUringBufferRingAllocatorimplementation which uses a fixed size for the buffers that are returned byallocate().
-
-
Constructor Summary
Constructors Constructor Description IoUringFixedBufferRingAllocator(int bufferSize)Create a new instanceIoUringFixedBufferRingAllocator(io.netty.buffer.ByteBufAllocator allocator, int bufferSize)Create a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBufallocate()Creates a new receive buffer to use by the buffer ring.voidlastBytesRead(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(io.netty.buffer.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
-
allocate
public io.netty.buffer.ByteBuf allocate()
Description copied from interface:IoUringBufferRingAllocatorCreates a new receive buffer to use by the buffer ring. The returnedByteBufmust be direct.- Specified by:
allocatein interfaceIoUringBufferRingAllocator
-
lastBytesRead
public void lastBytesRead(int attempted, int actual)Description copied from interface:IoUringBufferRingAllocatorSet the bytes that have been read for the last read operation that was full-filled out of the buffer ring.- Specified by:
lastBytesReadin interfaceIoUringBufferRingAllocator- Parameters:
attempted- the attempted bytes to read.actual- the number of bytes that could be read.
-
-