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.
Deprecated
as a consequence of
RecvByteBufAllocator.ExtendedHandle being deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
| private volatile int | |
| private volatile int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public int | maxBytesPerIndividualRead()
Implements io. |
| public DefaultMaxBytesRecvByteBufAllocator | maxBytesPerIndividualRead(int maxBytesPerIndividualRead)
Implements io. |
| public int | maxBytesPerRead()
Implements io. |
| public DefaultMaxBytesRecvByteBufAllocator | maxBytesPerRead(int maxBytesPerRead)
Implements io. |
| public synchronized Map. | maxBytesPerReadPair()
Implements io. |
| public DefaultMaxBytesRecvByteBufAllocator | maxBytesPerReadPair(int maxBytesPerRead, int maxBytesPerIndividualRead)
Implements io. |
| public RecvByteBufAllocator. | newHandle()
Implements io.
Deprecated
as a consequence of
Creates a new handle.
RecvByteBufAllocator.Handle being deprecated.
|
| maxBytesPerIndividualRead | back to summary |
|---|---|
| private volatile int maxBytesPerIndividualRead | |
| maxBytesPerRead | back to summary |
|---|---|
| private volatile int maxBytesPerRead | |
| DefaultMaxBytesRecvByteBufAllocator | back to summary |
|---|---|
| public DefaultMaxBytesRecvByteBufAllocator() | |
| DefaultMaxBytesRecvByteBufAllocator | back to summary |
|---|---|
| public DefaultMaxBytesRecvByteBufAllocator(int maxBytesPerRead, int maxBytesPerIndividualRead) | |
| checkMaxBytesPerReadPair | back to summary |
|---|---|
| private static void checkMaxBytesPerReadPair(int maxBytesPerRead, int maxBytesPerIndividualRead) | |
| maxBytesPerIndividualRead | back to summary |
|---|---|
| public int maxBytesPerIndividualRead() Implements io. Doc from io. Returns the maximum number of bytes to read per individual read operation.
a
| |
| maxBytesPerIndividualRead | back to summary |
|---|---|
| public DefaultMaxBytesRecvByteBufAllocator maxBytesPerIndividualRead(int maxBytesPerIndividualRead) Implements io. Doc from io. Sets 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.
| |
| maxBytesPerRead | back to summary |
|---|---|
| public int maxBytesPerRead() Implements io. Doc from io. Returns the maximum number of bytes to read per read loop.
a
| |
| maxBytesPerRead | back to summary |
|---|---|
| public DefaultMaxBytesRecvByteBufAllocator maxBytesPerRead(int maxBytesPerRead) Implements io. Doc from io. Sets 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.
| |
| maxBytesPerReadPair | back to summary |
|---|---|
| public synchronized Map. Implements io. Doc from io. Atomic 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.
| |
| maxBytesPerReadPair | back to summary |
|---|---|
| public DefaultMaxBytesRecvByteBufAllocator maxBytesPerReadPair(int maxBytesPerRead, int maxBytesPerIndividualRead) Implements io. Doc from io. Sets 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.
| |
| newHandle | back to summary |
|---|---|
| public RecvByteBufAllocator. Implements io. Doc from io. Deprecated as a consequence of Creates a new handle. The handle provides the actual operations and keeps the internal information which is required for predicting an optimal buffer capacity.
| |
Deprecated
as a consequence of RecvByteBufAllocator.ExtendedHandle being deprecated. See corresponding docs for further information.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private final UncheckedBooleanSupplier | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuf | allocate(ByteBufAllocator alloc)
Implements io. |
| public void | attemptedBytesRead(int
How many bytes the read operation will (or did) attempt to read. bytes)Implements io. |
| public int | attemptedBytesRead()
Implements io. |
| public boolean | continueReading()
Implements io. |
| public boolean | continueReading(UncheckedBooleanSupplier
A supplier that determines if there maybe more data to read. maybeMoreDataSupplier)Implements io. Handle#continueReading() except "more data" is determined by the supplier parameter.
|
| public int | guess()
Implements io. allocate(ByteBufAllocator) except that it does not allocate anything but just tells the
capacity.
|
| public void | incMessagesRead(int
The amount to increment by. amt)Implements io. |
| public void | lastBytesRead(int
The number of bytes from the previous read operation. This may be negative if an read error
occurs. If a negative value is seen it is expected to be return on the next call to
bytes)lastBytesRead(). A negative value will signal a termination condition enforced externally
to this class and is not required to be enforced in continueReading().Implements io. |
| public int | lastBytesRead()
Implements io. |
| public void | readComplete()
Implements io. |
| public void | reset(ChannelConfig
The channel configuration which may impact this object's behavior. config)Implements io. |
| attemptBytesRead | back to summary |
|---|---|
| private int attemptBytesRead | |
| bytesToRead | back to summary |
|---|---|
| private int bytesToRead | |
| defaultMaybeMoreSupplier | back to summary |
|---|---|
| private final UncheckedBooleanSupplier defaultMaybeMoreSupplier | |
| individualReadMax | back to summary |
|---|---|
| private int individualReadMax | |
| lastBytesRead | back to summary |
|---|---|
| private int lastBytesRead | |
| HandleImpl | back to summary |
|---|---|
| private HandleImpl() | |
| allocate | back to summary |
|---|---|
| public ByteBuf allocate(ByteBufAllocator alloc) Implements io. Doc from io. Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.
| |
| attemptedBytesRead | back to summary |
|---|---|
| public void attemptedBytesRead(int bytes) Implements io. Doc from io. Set how many bytes the read operation will (or did) attempt to read.
| |
| attemptedBytesRead | back to summary |
|---|---|
| public int attemptedBytesRead() Implements io. Doc from io. Get how many bytes the read operation will (or did) attempt to read.
| |
| continueReading | back to summary |
|---|---|
| public boolean continueReading() Implements io. Doc from io. Determine if the current read loop should continue.
| |
| continueReading | back to summary |
|---|---|
| public boolean continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier) Implements io. Doc from io. Same as
| |
| guess | back to summary |
|---|---|
| public int guess() Implements io. Doc from io. Similar to
| |
| incMessagesRead | back to summary |
|---|---|
| public void incMessagesRead(int amt) Implements io. Doc from io. Increment the number of messages that have been read for the current read loop.
| |
| lastBytesRead | back to summary |
|---|---|
| public void lastBytesRead(int bytes) Implements io. Doc from io. Set the bytes that have been read for the last read operation. This may be used to increment the number of bytes that have been read.
| |
| lastBytesRead | back to summary |
|---|---|
| public int lastBytesRead() Implements io. Doc from io. Get the amount of bytes for the previous read operation.
| |
| readComplete | back to summary |
|---|---|
| public void readComplete() Implements io. Doc from io. The read has completed.
| |
| reset | back to summary |
|---|---|
| public void reset(ChannelConfig config) Implements io. Doc from io. Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next read loop.
This may be used by
| |