Package io.netty.channel.uring
Class IoUringBufferRingConfig
- java.lang.Object
-
- io.netty.channel.uring.IoUringBufferRingConfig
-
public final class IoUringBufferRingConfig extends java.lang.Object
Configuration class for anIoUringBufferRing
. It will configure the buffer ring size, buffer group id and the chunk size.
-
-
Constructor Summary
Constructors Constructor Description IoUringBufferRingConfig(short bgId, short bufferRingSize, int batchSize, int maxUnreleasedBuffers, boolean incremental, IoUringBufferRingAllocator allocator)
Create a new configuration.IoUringBufferRingConfig(short bgId, short bufferRingSize, int maxUnreleasedBuffers, IoUringBufferRingAllocator allocator)
Create a new configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IoUringBufferRingAllocator
allocator()
Returns theIoUringBufferRingAllocator
to use to allocateByteBuf
s.int
batchSize()
Returns the size of the batch on how many buffers are added everytime we need to expand the buffer ring.short
bufferGroupId()
Returns the buffer group id to use.short
bufferRingSize()
Returns the size of the ring.boolean
equals(java.lang.Object o)
int
hashCode()
boolean
isIncremental()
Returns true if incremental mode should be used for the buffer ring.int
maxUnreleasedBuffers()
Returns the maximum buffers that can be allocated out of this buffer ring and are unreleased yet
-
-
-
Constructor Detail
-
IoUringBufferRingConfig
public IoUringBufferRingConfig(short bgId, short bufferRingSize, int maxUnreleasedBuffers, IoUringBufferRingAllocator allocator)
Create a new configuration.- Parameters:
bgId
- the buffer group id to use (must be non-negative).bufferRingSize
- the size of the ringmaxUnreleasedBuffers
- the maximum buffers that were allocated out of this buffer ring and are unreleased yet. Once this threshold is hit the usage of the buffer ring will be temporary disabled.allocator
- theIoUringBufferRingAllocator
to use to allocateByteBuf
s.
-
IoUringBufferRingConfig
public IoUringBufferRingConfig(short bgId, short bufferRingSize, int batchSize, int maxUnreleasedBuffers, boolean incremental, IoUringBufferRingAllocator allocator)
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
- the maximum buffers that can be allocated out of this buffer ring and are unreleased yet. Once this threshold is hit the usage of the buffer ring will be temporarily disabled.incremental
-true
if the buffer ring is using incremental buffer consumption.allocator
- theIoUringBufferRingAllocator
to use to allocateByteBuf
s.
-
-
Method Detail
-
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
public int maxUnreleasedBuffers()
Returns the maximum buffers that can be allocated out of this buffer ring and are unreleased yet- Returns:
- the max unreleased buffers.
-
allocator
public IoUringBufferRingAllocator allocator()
Returns theIoUringBufferRingAllocator
to use to allocateByteBuf
s.- Returns:
- the allocator.
-
isIncremental
public boolean isIncremental()
Returns true if incremental mode should be used for the buffer ring.- Returns:
true
if incremental mode is used,false
otherwise.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-