| Modifier and Type | Field and Description |
|---|---|
| private final ArrayDeque | |
| private static final InternalLogger | |
| private int | |
| private final PendingBytesTracker |
| Access | Constructor and Description |
|---|---|
| protected | AbstractCoalescingBufferQueue(Channel
the channel, int Channel which will have the Channel#isWritable() reflect the amount of queued
buffers or null if there is no writability state updated.the initial size of the underlying queue. initSize)Create a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final void | add(ByteBuf
to add to the tail of the queue buf, ChannelPromise to complete when all the bytes have been consumed and written, can be void. promise)Add a buffer to the end of the queue and associate a promise with it that should be completed when all the buffer's bytes have been consumed from the queue and written. |
| public final void | add(ByteBuf
to add to the tail of the queue buf, ChannelFutureListener to notify when all the bytes have been consumed and written, can be listener)null.Add a buffer to the end of the queue and associate a listener with it that should be completed when all the buffers bytes have been consumed from the queue and written. |
| public final void | addFirst(ByteBuf
to add to the head of the queue buf, ChannelPromise to complete when all the bytes have been consumed and written, can be void. promise)Add a buffer to the front of the queue and associate a promise with it that should be completed when all the buffer's bytes have been consumed from the queue and written. |
| private void | |
| protected abstract ByteBuf | compose(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next)
Calculate the result of |
| protected ByteBuf | composeFirst(ByteBufAllocator allocator, ByteBuf first)
Calculate the first |
| protected final ByteBuf | composeIntoComposite(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next)
Compose |
| protected final ByteBuf | Returns: The result ofcumulation + next.The allocator to use to allocate the new buffer. alloc, ByteBuf The current cumulation. cumulation, ByteBuf The next buffer. next)Compose |
| public final void | copyTo(AbstractCoalescingBufferQueue
to copy pending buffers to. dest)Copy all pending entries in this queue into the destination queue. |
| private void | |
| private void | |
| public final boolean | |
| public final int | |
| private void | |
| public final void | releaseAndFailAll(ChannelOutboundInvoker invoker, Throwable cause)
Release all buffers in the queue and complete all listeners and promises. |
| public final ByteBuf | Returns: aByteBuf composed of the enqueued buffers.The allocator used if a new alloc, int ByteBuf is generated during the aggregation process.the maximum number of readable bytes in the returned bytes, ChannelPromise ByteBuf, if bytes is greater
than readableBytes then a buffer of length readableBytes is returned.used to aggregate the promises and listeners for the constituent buffers. aggregatePromise)Remove a |
| protected abstract ByteBuf | Returns: theByteBuf which represents an empty queue.The value to return when |
| public final ByteBuf | Returns: the firstByteBuf from the queue.used to aggregate the promises and listeners for the returned buffer. aggregatePromise)Remove the first |
| protected final int | Returns: the number of elements in this queue.Get the number of elements in this queue added via one of the |
| private static ChannelFutureListener | |
| public String | |
| public final void | writeAndRemoveAll(ChannelHandlerContext
The context to write all elements to. ctx)Writes all remaining elements in this queue. |
| bufAndListenerPairs | back to summary |
|---|---|
| private final ArrayDeque<Object> bufAndListenerPairs | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| readableBytes | back to summary |
|---|---|
| private int readableBytes | |
| tracker | back to summary |
|---|---|
| private final PendingBytesTracker tracker | |
| AbstractCoalescingBufferQueue | back to summary |
|---|---|
| protected AbstractCoalescingBufferQueue(Channel channel, int initSize) Create a new instance.
| |
| add | back to summary |
|---|---|
| public final void add(ByteBuf buf) Add a buffer to the end of the queue. | |
| add | back to summary |
|---|---|
| public final void add(ByteBuf buf, ChannelPromise promise) Add a buffer to the end of the queue and associate a promise with it that should be completed when all the buffer's bytes have been consumed from the queue and written.
| |
| add | back to summary |
|---|---|
| public final void add(ByteBuf buf, ChannelFutureListener listener) Add a buffer to the end of the queue and associate a listener with it that should be completed when all the buffers bytes have been consumed from the queue and written.
| |
| addFirst | back to summary |
|---|---|
| public final void addFirst(ByteBuf buf, ChannelPromise promise) Add a buffer to the front of the queue and associate a promise with it that should be completed when all the buffer's bytes have been consumed from the queue and written.
| |
| addFirst | back to summary |
|---|---|
| private void addFirst(ByteBuf buf, ChannelFutureListener listener) | |
| compose | back to summary |
|---|---|
| protected abstract ByteBuf compose(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next) Calculate the result of | |
| composeFirst | back to summary |
|---|---|
| protected ByteBuf composeFirst(ByteBufAllocator allocator, ByteBuf first) Calculate the first | |
| composeIntoComposite | back to summary |
|---|---|
| protected final ByteBuf composeIntoComposite(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next) Compose | |
| copyAndCompose | back to summary |
|---|---|
| protected final ByteBuf copyAndCompose(ByteBufAllocator alloc, ByteBuf cumulation, ByteBuf next) Compose
| |
| copyTo | back to summary |
|---|---|
| public final void copyTo(AbstractCoalescingBufferQueue dest) Copy all pending entries in this queue into the destination queue.
| |
| decrementReadableBytes | back to summary |
|---|---|
| private void decrementReadableBytes(int decrement) | |
| incrementReadableBytes | back to summary |
|---|---|
| private void incrementReadableBytes(int increment) | |
| isEmpty | back to summary |
|---|---|
| public final boolean isEmpty() Are there pending buffers in the queue. | |
| readableBytes | back to summary |
|---|---|
| public final int readableBytes() The number of readable bytes. | |
| releaseAndCompleteAll | back to summary |
|---|---|
| private void releaseAndCompleteAll(ChannelFuture future) | |
| releaseAndFailAll | back to summary |
|---|---|
| public final void releaseAndFailAll(ChannelOutboundInvoker invoker, Throwable cause) Release all buffers in the queue and complete all listeners and promises. | |
| remove | back to summary |
|---|---|
| public final ByteBuf remove(ByteBufAllocator alloc, int bytes, ChannelPromise aggregatePromise) Remove a
| |
| removeEmptyValue | back to summary |
|---|---|
| protected abstract ByteBuf removeEmptyValue() The value to return when | |
| removeFirst | back to summary |
|---|---|
| public final ByteBuf removeFirst(ChannelPromise aggregatePromise) Remove the first
| |
| size | back to summary |
|---|---|
| protected final int size() Get the number of elements in this queue added via one of the
| |
| toChannelFutureListener | back to summary |
|---|---|
| private static ChannelFutureListener toChannelFutureListener(ChannelPromise promise) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| writeAndRemoveAll | back to summary |
|---|---|
| public final void writeAndRemoveAll(ChannelHandlerContext ctx) Writes all remaining elements in this queue.
| |