| Modifier and Type | Field and Description |
|---|---|
| private final ArrayDeque | |
| private static final InternalLogger | |
| private int |
| Access | Constructor and Description |
|---|---|
| protected | AbstractCoalescingBufferQueue(int
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(Buffer
to add to the tail of the queue buf, Promise<Void> 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(Buffer
to add to the tail of the queue buf, FutureListener<Void> 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(Buffer
to add to the head of the queue buf, Promise<Void> 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 Buffer | compose(BufferAllocator alloc, Buffer cumulation, Buffer next)
Calculate the result of |
| protected Buffer | composeFirst(BufferAllocator allocator, Buffer first)
Calculate the first |
| protected final Buffer | composeIntoComposite(BufferAllocator alloc, Buffer cumulation, Buffer next)
Compose |
| protected final Buffer | Returns: The result ofcumulation + next.The allocator to use to allocate the new buffer. alloc, Buffer The current cumulation. cumulation, Buffer The next buffer. next, int The minimum buffer size - the resulting buffer will grow by at least this much. minIncrement)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 Buffer | Returns: aBuffer composed of the enqueued buffers.The allocator used if a new alloc, int Buffer is generated during the aggregation process.the maximum number of readable bytes in the returned bytes, Promise<Void> Buffer, 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 Buffer | Returns: theBuffer which represents an empty queue.The value to return when |
| public final Buffer | Returns: the firstBuffer 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 |
| 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 | |
| AbstractCoalescingBufferQueue | back to summary |
|---|---|
| protected AbstractCoalescingBufferQueue(int initSize) Create a new instance.
| |
| add | back to summary |
|---|---|
| public final void add(Buffer buf) Add a buffer to the end of the queue. | |
| add | back to summary |
|---|---|
| public final void add(Buffer buf, Promise<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. | |
| add | back to summary |
|---|---|
| public final void add(Buffer buf, FutureListener<Void> 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(Buffer buf, Promise<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. | |
| addFirst | back to summary |
|---|---|
| private void addFirst(Buffer buf, FutureListener<Void> listener) | |
| compose | back to summary |
|---|---|
| protected abstract Buffer compose(BufferAllocator alloc, Buffer cumulation, Buffer next) Calculate the result of | |
| composeFirst | back to summary |
|---|---|
| protected Buffer composeFirst(BufferAllocator allocator, Buffer first) Calculate the first | |
| composeIntoComposite | back to summary |
|---|---|
| protected final Buffer composeIntoComposite(BufferAllocator alloc, Buffer cumulation, Buffer next) Compose | |
| copyAndCompose | back to summary |
|---|---|
| protected final Buffer copyAndCompose(BufferAllocator alloc, Buffer cumulation, Buffer next, int minIncrement) 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(Future<Void> 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 Buffer remove(BufferAllocator alloc, int bytes, Promise<Void> aggregatePromise) Remove a
| |
| removeEmptyValue | back to summary |
|---|---|
| protected abstract Buffer removeEmptyValue() The value to return when | |
| removeFirst | back to summary |
|---|---|
| public final Buffer removeFirst(Promise<Void> 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
| |
| 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.
| |