public class DefaultMaxBytesRecvByteBufAllocator extends java.lang.Object implements MaxBytesRecvByteBufAllocator
RecvByteBufAllocator
that yields a buffer size prediction based upon decrementing the value from
the max bytes per read.Modifier and Type | Class and Description |
---|---|
private class |
DefaultMaxBytesRecvByteBufAllocator.HandleImpl |
RecvByteBufAllocator.DelegatingHandle, RecvByteBufAllocator.ExtendedHandle, RecvByteBufAllocator.Handle
Modifier and Type | Field and Description |
---|---|
private int |
maxBytesPerIndividualRead |
private int |
maxBytesPerRead |
Constructor and Description |
---|
DefaultMaxBytesRecvByteBufAllocator() |
DefaultMaxBytesRecvByteBufAllocator(int maxBytesPerRead,
int maxBytesPerIndividualRead) |
Modifier and Type | Method and Description |
---|---|
private static void |
checkMaxBytesPerReadPair(int maxBytesPerRead,
int maxBytesPerIndividualRead) |
int |
maxBytesPerIndividualRead()
Returns the maximum number of bytes to read per individual read operation.
|
DefaultMaxBytesRecvByteBufAllocator |
maxBytesPerIndividualRead(int maxBytesPerIndividualRead)
Sets the maximum number of bytes to read per individual read operation.
|
int |
maxBytesPerRead()
Returns the maximum number of bytes to read per read loop.
|
DefaultMaxBytesRecvByteBufAllocator |
maxBytesPerRead(int maxBytesPerRead)
Sets the maximum number of bytes to read per read loop.
|
java.util.Map.Entry<java.lang.Integer,java.lang.Integer> |
maxBytesPerReadPair()
Atomic way to get the maximum number of bytes to read for a read loop and per individual read operation.
|
DefaultMaxBytesRecvByteBufAllocator |
maxBytesPerReadPair(int maxBytesPerRead,
int maxBytesPerIndividualRead)
Sets the maximum number of bytes to read for a read loop and per individual read operation.
|
RecvByteBufAllocator.Handle |
newHandle()
Creates a new handle.
|
private volatile int maxBytesPerRead
private volatile int maxBytesPerIndividualRead
public DefaultMaxBytesRecvByteBufAllocator()
public DefaultMaxBytesRecvByteBufAllocator(int maxBytesPerRead, int maxBytesPerIndividualRead)
public RecvByteBufAllocator.Handle newHandle()
RecvByteBufAllocator
newHandle
in interface RecvByteBufAllocator
public int maxBytesPerRead()
MaxBytesRecvByteBufAllocator
channelRead()
event.
If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.maxBytesPerRead
in interface MaxBytesRecvByteBufAllocator
public DefaultMaxBytesRecvByteBufAllocator maxBytesPerRead(int maxBytesPerRead)
MaxBytesRecvByteBufAllocator
maxBytesPerRead
in interface MaxBytesRecvByteBufAllocator
public int maxBytesPerIndividualRead()
MaxBytesRecvByteBufAllocator
channelRead()
event.
If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.maxBytesPerIndividualRead
in interface MaxBytesRecvByteBufAllocator
public DefaultMaxBytesRecvByteBufAllocator maxBytesPerIndividualRead(int maxBytesPerIndividualRead)
MaxBytesRecvByteBufAllocator
maxBytesPerIndividualRead
in interface MaxBytesRecvByteBufAllocator
public java.util.Map.Entry<java.lang.Integer,java.lang.Integer> maxBytesPerReadPair()
MaxBytesRecvByteBufAllocator
maxBytesPerReadPair
in interface MaxBytesRecvByteBufAllocator
MaxBytesRecvByteBufAllocator.maxBytesPerRead()
. The Value is from MaxBytesRecvByteBufAllocator.maxBytesPerIndividualRead()
private static void checkMaxBytesPerReadPair(int maxBytesPerRead, int maxBytesPerIndividualRead)
public DefaultMaxBytesRecvByteBufAllocator maxBytesPerReadPair(int maxBytesPerRead, int maxBytesPerIndividualRead)
MaxBytesRecvByteBufAllocator
maxBytesPerReadPair
in interface MaxBytesRecvByteBufAllocator
maxBytesPerRead
- see MaxBytesRecvByteBufAllocator.maxBytesPerRead(int)
maxBytesPerIndividualRead
- see MaxBytesRecvByteBufAllocator.maxBytesPerIndividualRead(int)