Class DefaultMaxBytesRecvByteBufAllocator
java.lang.Object
io.netty.channel.DefaultMaxBytesRecvByteBufAllocator
- All Implemented Interfaces:
MaxBytesRecvByteBufAllocator, RecvByteBufAllocator
public class DefaultMaxBytesRecvByteBufAllocator
extends Object
implements MaxBytesRecvByteBufAllocator
The
RecvByteBufAllocator that yields a buffer size prediction based upon decrementing the value from
the max bytes per read.-
Nested Class Summary
Nested classes/interfaces inherited from interface RecvByteBufAllocator
RecvByteBufAllocator.DelegatingHandle, RecvByteBufAllocator.ExtendedHandle, RecvByteBufAllocator.Handle -
Constructor Summary
ConstructorsConstructorDescriptionDefaultMaxBytesRecvByteBufAllocator(int maxBytesPerRead, int maxBytesPerIndividualRead) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum number of bytes to read per individual read operation. achannelRead()event.maxBytesPerIndividualRead(int maxBytesPerIndividualRead) Sets the maximum number of bytes to read per individual read operation.intReturns the maximum number of bytes to read per read loop. achannelRead()event.maxBytesPerRead(int maxBytesPerRead) Sets the maximum number of bytes to read per read loop.Atomic way to get the maximum number of bytes to read for a read loop and per individual read operation.maxBytesPerReadPair(int maxBytesPerRead, int maxBytesPerIndividualRead) Sets the maximum number of bytes to read for a read loop and per individual read operation.Creates a new handle.
-
Constructor Details
-
DefaultMaxBytesRecvByteBufAllocator
public DefaultMaxBytesRecvByteBufAllocator() -
DefaultMaxBytesRecvByteBufAllocator
public DefaultMaxBytesRecvByteBufAllocator(int maxBytesPerRead, int maxBytesPerIndividualRead)
-
-
Method Details
-
newHandle
Description copied from interface:RecvByteBufAllocatorCreates a new handle. The handle provides the actual operations and keeps the internal information which is required for predicting an optimal buffer capacity.- Specified by:
newHandlein interfaceRecvByteBufAllocator
-
maxBytesPerRead
public int maxBytesPerRead()Description copied from interface:MaxBytesRecvByteBufAllocatorReturns the maximum number of bytes to read per read loop. achannelRead()event. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
maxBytesPerReadin interfaceMaxBytesRecvByteBufAllocator
-
maxBytesPerRead
Description copied from interface:MaxBytesRecvByteBufAllocatorSets the maximum number of bytes to read per read loop. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
maxBytesPerReadin interfaceMaxBytesRecvByteBufAllocator
-
maxBytesPerIndividualRead
public int maxBytesPerIndividualRead()Description copied from interface:MaxBytesRecvByteBufAllocatorReturns the maximum number of bytes to read per individual read operation. achannelRead()event. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
maxBytesPerIndividualReadin interfaceMaxBytesRecvByteBufAllocator
-
maxBytesPerIndividualRead
Description copied from interface:MaxBytesRecvByteBufAllocatorSets the maximum number of bytes to read per individual read operation. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
maxBytesPerIndividualReadin interfaceMaxBytesRecvByteBufAllocator
-
maxBytesPerReadPair
Description copied from interface:MaxBytesRecvByteBufAllocatorAtomic way to get the maximum number of bytes to read for a read loop and per individual read operation. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
maxBytesPerReadPairin interfaceMaxBytesRecvByteBufAllocator- Returns:
- The Key is from
MaxBytesRecvByteBufAllocator.maxBytesPerRead(). The Value is fromMaxBytesRecvByteBufAllocator.maxBytesPerIndividualRead()
-
maxBytesPerReadPair
public DefaultMaxBytesRecvByteBufAllocator maxBytesPerReadPair(int maxBytesPerRead, int maxBytesPerIndividualRead) Description copied from interface:MaxBytesRecvByteBufAllocatorSets the maximum number of bytes to read for a read loop and per individual read operation. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
maxBytesPerReadPairin interfaceMaxBytesRecvByteBufAllocator- Parameters:
maxBytesPerRead- seeMaxBytesRecvByteBufAllocator.maxBytesPerRead(int)maxBytesPerIndividualRead- seeMaxBytesRecvByteBufAllocator.maxBytesPerIndividualRead(int)
-