Class IoUringBufferRingConfig
java.lang.Object
io.netty.channel.uring.IoUringBufferRingConfig
Configuration class for an
IoUringBufferRing.
It will configure the buffer ring size, buffer group id and the chunk size.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IoUringBufferRingAllocatorprivate final booleanprivate final intprivate final shortprivate final shortprivate final booleanprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionIoUringBufferRingConfig(short bgId, short bufferRingSize, int batchSize, int maxUnreleasedBuffers, boolean incremental, IoUringBufferRingAllocator allocator) Deprecated.privateIoUringBufferRingConfig(short bgId, short bufferRingSize, int batchSize, int maxUnreleasedBuffers, boolean incremental, IoUringBufferRingAllocator allocator, boolean batchAllocation) IoUringBufferRingConfig(short bgId, short bufferRingSize, int maxUnreleasedBuffers, IoUringBufferRingAllocator allocator) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionReturns theIoUringBufferRingAllocatorto use to allocateByteBufs.intReturns the size of the batch on how many buffers are added everytime we need to expand the buffer ring.shortReturns the buffer group id to use.shortReturns the size of the ring.builder()private static shortcheckBufferRingSize(short bufferRingSize) booleaninthashCode()booleanReturnstrueif the ring should always be filled via a batch allocation orfalseif we will try to allocate a newByteBufas we used a buffer from the ring.booleanReturns true if incremental mode should be used for the buffer ring.intDeprecated.will be removed as it as no effect.
-
Field Details
-
bgId
private final short bgId -
bufferRingSize
private final short bufferRingSize -
batchSize
private final int batchSize -
maxUnreleasedBuffers
private final int maxUnreleasedBuffers -
incremental
private final boolean incremental -
allocator
-
batchAllocation
private final boolean batchAllocation
-
-
Constructor Details
-
IoUringBufferRingConfig
@Deprecated public IoUringBufferRingConfig(short bgId, short bufferRingSize, int maxUnreleasedBuffers, IoUringBufferRingAllocator allocator) Deprecated.Create a new configuration.- Parameters:
bgId- the buffer group id to use (must be non-negative).bufferRingSize- the size of the ringmaxUnreleasedBuffers- this parameter is ignored by the buffer ring.allocator- theIoUringBufferRingAllocatorto use to allocateByteBufs.
-
IoUringBufferRingConfig
@Deprecated public IoUringBufferRingConfig(short bgId, short bufferRingSize, int batchSize, int maxUnreleasedBuffers, boolean incremental, IoUringBufferRingAllocator allocator) Deprecated.Create a new configuration.- Parameters:
bgId- the buffer group id to use (must be non-negative).bufferRingSize- the size of the ringbatchSize- the size of the batch on how many buffers are added everytime we need to expand the buffer ring.maxUnreleasedBuffers- this parameter is ignored by the buffer ring.incremental-trueif the buffer ring is using incremental buffer consumption.allocator- theIoUringBufferRingAllocatorto use to allocateByteBufs.
-
IoUringBufferRingConfig
private IoUringBufferRingConfig(short bgId, short bufferRingSize, int batchSize, int maxUnreleasedBuffers, boolean incremental, IoUringBufferRingAllocator allocator, boolean batchAllocation)
-
-
Method Details
-
bufferGroupId
public short bufferGroupId()Returns the buffer group id to use.- Returns:
- the buffer group id to use.
-
bufferRingSize
public short bufferRingSize()Returns the size of the ring.- Returns:
- the size of the ring.
-
batchSize
public int batchSize()Returns the size of the batch on how many buffers are added everytime we need to expand the buffer ring.- Returns:
- batch size.
-
maxUnreleasedBuffers
Deprecated.will be removed as it as no effect.Returns the maximum buffers that can be allocated out of this buffer ring and are unreleased yet- Returns:
- the max unreleased buffers.
-
allocator
Returns theIoUringBufferRingAllocatorto use to allocateByteBufs.- Returns:
- the allocator.
-
isBatchAllocation
public boolean isBatchAllocation()Returnstrueif the ring should always be filled via a batch allocation orfalseif we will try to allocate a newByteBufas we used a buffer from the ring.- Returns:
trueif the ring should always be filled via a batch allocation.
-
isIncremental
public boolean isIncremental()Returns true if incremental mode should be used for the buffer ring.- Returns:
trueif incremental mode is used,falseotherwise.
-
checkBufferRingSize
private static short checkBufferRingSize(short bufferRingSize) -
equals
-
hashCode
-
builder
-
IoUringBufferRingConfig.Builder.