public class AdaptiveRecvByteBufAllocator extends java.lang.Object implements RecvByteBufAllocator
RecvByteBufAllocator
that automatically increases and
decreases the predicted buffer size on feed back.
It gradually increases the expected number of readable bytes if the previous read fully filled the allocated buffer. It gradually decreases the expected number of readable bytes if the read operation was not able to fill a certain amount of the allocated buffer two times consecutively. Otherwise, it keeps returning the same prediction.
RecvByteBufAllocator.Handle
Modifier and Type | Field and Description |
---|---|
static AdaptiveRecvByteBufAllocator |
DEFAULT |
Constructor and Description |
---|
AdaptiveRecvByteBufAllocator(int minimum,
int initial,
int maximum)
Creates a new predictor with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
RecvByteBufAllocator.Handle |
newHandle()
Creates a new handle.
|
public static final AdaptiveRecvByteBufAllocator DEFAULT
public AdaptiveRecvByteBufAllocator(int minimum, int initial, int maximum)
minimum
- the inclusive lower bound of the expected buffer sizeinitial
- the initial buffer size when no feed back was receivedmaximum
- the inclusive upper bound of the expected buffer sizepublic RecvByteBufAllocator.Handle newHandle()
RecvByteBufAllocator
newHandle
in interface RecvByteBufAllocator
Copyright © 2008–2018 The Netty Project. All rights reserved.