MaxMessagesRecvByteBufAllocator which respects ChannelConfig#isAutoRead()
and also prevents overflow.
| Modifier and Type | Class and Description |
|---|---|
| public abstract class | DefaultMaxMessagesRecvByteBufAllocator.
Deprecated
as a consequence of Focuses on enforcing the maximum messages per read condition for RecvByteBufAllocator.ExtendedHandle being deprecated.
continueReading().
|
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private volatile int | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | maxMessagesPerRead()
Implements io. |
| public MaxMessagesRecvByteBufAllocator | maxMessagesPerRead(int maxMessagesPerRead)
Implements io. |
| public DefaultMaxMessagesRecvByteBufAllocator | Returns: this.
Determine if future instances of |
| public final boolean | Returns:
Get if future instances of |
| ignoreBytesRead | back to summary |
|---|---|
| private final boolean ignoreBytesRead | |
| maxMessagesPerRead | back to summary |
|---|---|
| private volatile int maxMessagesPerRead | |
| respectMaybeMoreData | back to summary |
|---|---|
| private volatile boolean respectMaybeMoreData | |
| DefaultMaxMessagesRecvByteBufAllocator | back to summary |
|---|---|
| public DefaultMaxMessagesRecvByteBufAllocator() | |
| DefaultMaxMessagesRecvByteBufAllocator | back to summary |
|---|---|
| public DefaultMaxMessagesRecvByteBufAllocator(int maxMessagesPerRead) | |
| DefaultMaxMessagesRecvByteBufAllocator | back to summary |
|---|---|
| pack-priv DefaultMaxMessagesRecvByteBufAllocator(int maxMessagesPerRead, boolean ignoreBytesRead) | |
| maxMessagesPerRead | back to summary |
|---|---|
| public int maxMessagesPerRead() Implements io. Doc from io. Returns the maximum number of messages to read per read loop.
a
| |
| maxMessagesPerRead | back to summary |
|---|---|
| public MaxMessagesRecvByteBufAllocator maxMessagesPerRead(int maxMessagesPerRead) Implements io. Doc from io. Sets the maximum number of messages to read per read loop. If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages.
| |
| respectMaybeMoreData | back to summary |
|---|---|
| public DefaultMaxMessagesRecvByteBufAllocator respectMaybeMoreData(boolean respectMaybeMoreData) Determine if future instances of
| |
| respectMaybeMoreData | back to summary |
|---|---|
| public final boolean respectMaybeMoreData() Get if future instances of
| |
Deprecated
as a consequence of RecvByteBufAllocator.ExtendedHandle being deprecated. See corresponding docs for further information.
continueReading().
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private ChannelConfig | |
| private final UncheckedBooleanSupplier | |
| private int | |
| private int | |
| private final boolean | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuf | allocate(ByteBufAllocator alloc)
Implements io. |
| public int | attemptedBytesRead()
Implements io. |
| public void | attemptedBytesRead(int
How many bytes the read operation will (or did) attempt to read. bytes)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 final 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 final 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. ChannelConfig#getMaxMessagesPerRead() is used.
|
| protected final int |
| attemptedBytesRead | back to summary |
|---|---|
| private int attemptedBytesRead | |
| config | back to summary |
|---|---|
| private ChannelConfig config | |
| defaultMaybeMoreSupplier | back to summary |
|---|---|
| private final UncheckedBooleanSupplier defaultMaybeMoreSupplier | |
| lastBytesRead | back to summary |
|---|---|
| private int lastBytesRead | |
| maxMessagePerRead | back to summary |
|---|---|
| private int maxMessagePerRead | |
| respectMaybeMoreData | back to summary |
|---|---|
| private final boolean respectMaybeMoreData | |
| totalBytesRead | back to summary |
|---|---|
| private int totalBytesRead | |
| totalMessages | back to summary |
|---|---|
| private int totalMessages | |
| MaxMessageHandle | back to summary |
|---|---|
| public MaxMessageHandle() | |
| 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 int attemptedBytesRead() Implements io. Doc from io. Get how many bytes the read operation will (or did) attempt to read.
| |
| 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.
| |
| 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
| |
| incMessagesRead | back to summary |
|---|---|
| public final 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 final 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. Only
| |
| totalBytesRead | back to summary |
|---|---|
| protected final int totalBytesRead() | |