AbstractChannel to store its pending
outbound write requests.
All methods must be called by a transport implementation from an I/O thread, except the following ones:
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| private final Channel | |
| pack-priv static final int | |
| private volatile Runnable | |
| private int | |
| private ChannelOutboundBuffer. | |
| private boolean | |
| private static final InternalLogger | |
| private static final FastThreadLocal | |
| private int | |
| private long | |
| private ChannelOutboundBuffer. | |
| private static final AtomicLongFieldUpdater | |
| private volatile long | |
| private ChannelOutboundBuffer. | |
| private volatile int | |
| private static final AtomicIntegerFieldUpdater |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | addMessage(Object msg, int size, ChannelPromise promise)
Add given message to this |
| public long | |
| public long | bytesBeforeWritable()
Get how many bytes must be drained from the underlying buffer until |
| private void | |
| private void | |
| pack-priv void | |
| pack-priv void | |
| public Object | current()
Return the current message to write or |
| public long | Returns: 0 if nothing was flushed before for the current message or there is no current messageReturn the current message flush progress. |
| pack-priv void | decrementPendingOutboundBytes(long size)
Decrement the pending bytes which will be written at some point. |
| private void | |
| private static ByteBuffer[] | |
| pack-priv void | |
| private void | |
| public void | forEachFlushedMessage(ChannelOutboundBuffer.
Call |
| public boolean | getUserDefinedWritability(int index)
Returns |
| pack-priv void | incrementPendingOutboundBytes(long size)
Increment the pending bytes which will be written at some point. |
| private void | |
| public boolean | isEmpty()
Returns |
| private boolean | |
| public boolean | isWritable()
Returns |
| public int | nioBufferCount()
Returns the number of |
| public ByteBuffer[] | nioBuffers()
Returns an array of direct NIO buffers if the currently pending messages are made of |
| public ByteBuffer[] | nioBuffers(int
The maximum amount of buffers that will be added to the return value. maxCount, long A hint toward the maximum number of bytes to include as part of the return value. Note that this
value maybe exceeded because we make a best effort to include at least 1 maxBytes)ByteBuffer
in the return value to ensure write progress is made.Returns an array of direct NIO buffers if the currently pending messages are made of |
| private static int | nioBuffers(ChannelOutboundBuffer.
|
| public long | nioBufferSize()
Returns the number of bytes that can be written out of the |
| public void | |
| public void | |
| public boolean | |
| public boolean | remove(Throwable cause)
Will remove the current message, mark its |
| private boolean | |
| public void | removeBytes(long writtenBytes)
Removes the fully written entries and update the reader index of the partially written entry. |
| private void | |
| private static void | |
| private static void | |
| private void | |
| public void | setUserDefinedWritability(int index, boolean writable)
Sets a user-defined writability flag at the specified index. |
| private void | |
| private void | |
| public int | |
| private static long | |
| public long | |
| private static int |
| channel | back to summary |
|---|---|
| private final Channel channel | |
| CHANNEL_OUTBOUND_BUFFER_ENTRY_OVERHEAD | back to summary |
|---|---|
| pack-priv static final int CHANNEL_OUTBOUND_BUFFER_ENTRY_OVERHEAD | |
| fireChannelWritabilityChangedTask | back to summary |
|---|---|
| private volatile Runnable fireChannelWritabilityChangedTask | |
| flushed | back to summary |
|---|---|
| private int flushed | |
| flushedEntry | back to summary |
|---|---|
| private ChannelOutboundBuffer. | |
| inFail | back to summary |
|---|---|
| private boolean inFail | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| NIO_BUFFERS | back to summary |
|---|---|
| private static final FastThreadLocal<ByteBuffer[]> NIO_BUFFERS | |
| nioBufferCount | back to summary |
|---|---|
| private int nioBufferCount | |
| nioBufferSize | back to summary |
|---|---|
| private long nioBufferSize | |
| tailEntry | back to summary |
|---|---|
| private ChannelOutboundBuffer. | |
| TOTAL_PENDING_SIZE_UPDATER | back to summary |
|---|---|
| private static final AtomicLongFieldUpdater<ChannelOutboundBuffer> TOTAL_PENDING_SIZE_UPDATER | |
| totalPendingSize | back to summary |
|---|---|
private volatile long totalPendingSize
| |
| unflushedEntry | back to summary |
|---|---|
| private ChannelOutboundBuffer. | |
| unwritable | back to summary |
|---|---|
private volatile int unwritable
| |
| UNWRITABLE_UPDATER | back to summary |
|---|---|
| private static final AtomicIntegerFieldUpdater<ChannelOutboundBuffer> UNWRITABLE_UPDATER | |
| ChannelOutboundBuffer | back to summary |
|---|---|
| pack-priv ChannelOutboundBuffer(AbstractChannel channel) | |
| addFlush | back to summary |
|---|---|
| public void addFlush() Add a flush to this | |
| addMessage | back to summary |
|---|---|
| public void addMessage(Object msg, int size, ChannelPromise promise) Add given message to this | |
| bytesBeforeUnwritable | back to summary |
|---|---|
| public long bytesBeforeUnwritable() Get how many bytes can be written until | |
| bytesBeforeWritable | back to summary |
|---|---|
| public long bytesBeforeWritable() Get how many bytes must be drained from the underlying buffer until | |
| clearNioBuffers | back to summary |
|---|---|
| private void clearNioBuffers() | |
| clearUserDefinedWritability | back to summary |
|---|---|
| private void clearUserDefinedWritability(int index) | |
| close | back to summary |
|---|---|
| pack-priv void close(final Throwable cause, final boolean allowChannelOpen) | |
| close | back to summary |
|---|---|
| pack-priv void close(ClosedChannelException cause) | |
| current | back to summary |
|---|---|
| public Object current() Return the current message to write or | |
| currentProgress | back to summary |
|---|---|
| public long currentProgress() Return the current message flush progress.
| |
| decrementPendingOutboundBytes | back to summary |
|---|---|
| pack-priv void decrementPendingOutboundBytes(long size) Decrement the pending bytes which will be written at some point. This method is thread-safe! | |
| decrementPendingOutboundBytes | back to summary |
|---|---|
| private void decrementPendingOutboundBytes(long size, boolean invokeLater, boolean notifyWritability) | |
| expandNioBufferArray | back to summary |
|---|---|
| private static ByteBuffer[] expandNioBufferArray(ByteBuffer[] array, int neededSpace, int size) | |
| failFlushed | back to summary |
|---|---|
| pack-priv void failFlushed(Throwable cause, boolean notify) | |
| fireChannelWritabilityChanged | back to summary |
|---|---|
| private void fireChannelWritabilityChanged(boolean invokeLater) | |
| forEachFlushedMessage | back to summary |
|---|---|
| public void forEachFlushedMessage(ChannelOutboundBuffer. Call | |
| getUserDefinedWritability | back to summary |
|---|---|
| public boolean getUserDefinedWritability(int index) Returns | |
| incrementPendingOutboundBytes | back to summary |
|---|---|
| pack-priv void incrementPendingOutboundBytes(long size) Increment the pending bytes which will be written at some point. This method is thread-safe! | |
| incrementPendingOutboundBytes | back to summary |
|---|---|
| private void incrementPendingOutboundBytes(long size, boolean invokeLater) | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns | |
| isFlushedEntry | back to summary |
|---|---|
| private boolean isFlushedEntry(ChannelOutboundBuffer. | |
| isWritable | back to summary |
|---|---|
| public boolean isWritable() Returns | |
| nioBufferCount | back to summary |
|---|---|
| public int nioBufferCount() Returns the number of | |
| nioBuffers | back to summary |
|---|---|
| public ByteBuffer[] nioBuffers() Returns an array of direct NIO buffers if the currently pending messages are made of
Note that the returned array is reused and thus should not escape
| |
| nioBuffers | back to summary |
|---|---|
| public ByteBuffer[] nioBuffers(int maxCount, long maxBytes) Returns an array of direct NIO buffers if the currently pending messages are made of
Note that the returned array is reused and thus should not escape
| |
| nioBuffers | back to summary |
|---|---|
| private static int nioBuffers(ChannelOutboundBuffer. | |
| nioBufferSize | back to summary |
|---|---|
| public long nioBufferSize() Returns the number of bytes that can be written out of the | |
| progress | back to summary |
|---|---|
| public void progress(long amount) Notify the | |
| recycle | back to summary |
|---|---|
| public void recycle()
Deprecated
| |
| remove | back to summary |
|---|---|
| public boolean remove() Will remove the current message, mark its | |
| remove | back to summary |
|---|---|
| public boolean remove(Throwable cause) Will remove the current message, mark its | |
| remove0 | back to summary |
|---|---|
| private boolean remove0(Throwable cause, boolean notifyWritability) | |
| removeBytes | back to summary |
|---|---|
| public void removeBytes(long writtenBytes) Removes the fully written entries and update the reader index of the partially written entry.
This operation assumes all messages in this buffer is | |
| removeEntry | back to summary |
|---|---|
| private void removeEntry(ChannelOutboundBuffer. | |
| safeFail | back to summary |
|---|---|
| private static void safeFail(ChannelPromise promise, Throwable cause) | |
| safeSuccess | back to summary |
|---|---|
| private static void safeSuccess(ChannelPromise promise) | |
| setUnwritable | back to summary |
|---|---|
| private void setUnwritable(boolean invokeLater) | |
| setUserDefinedWritability | back to summary |
|---|---|
| public void setUserDefinedWritability(int index, boolean writable) Sets a user-defined writability flag at the specified index. | |
| setUserDefinedWritability | back to summary |
|---|---|
| private void setUserDefinedWritability(int index) | |
| setWritable | back to summary |
|---|---|
| private void setWritable(boolean invokeLater) | |
| size | back to summary |
|---|---|
| public int size() Returns the number of flushed messages in this | |
| total | back to summary |
|---|---|
| private static long total(Object msg) | |
| totalPendingWriteBytes | back to summary |
|---|---|
| public long totalPendingWriteBytes() | |
| writabilityMask | back to summary |
|---|---|
| private static int writabilityMask(int index) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv ByteBuffer | |
| pack-priv ByteBuffer[] | |
| pack-priv boolean | |
| pack-priv int | |
| private final Recycler. | |
| pack-priv Object | |
| pack-priv ChannelOutboundBuffer. | |
| pack-priv int | |
| pack-priv long | |
| pack-priv ChannelPromise | |
| private static final ObjectPool | |
| pack-priv long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | |
| pack-priv static ChannelOutboundBuffer. | |
| pack-priv void | |
| pack-priv ChannelOutboundBuffer. |
| buf | back to summary |
|---|---|
| pack-priv ByteBuffer buf | |
| bufs | back to summary |
|---|---|
| pack-priv ByteBuffer[] bufs | |
| cancelled | back to summary |
|---|---|
| pack-priv boolean cancelled | |
| count | back to summary |
|---|---|
| pack-priv int count | |
| handle | back to summary |
|---|---|
| private final Recycler. | |
| msg | back to summary |
|---|---|
| pack-priv Object msg | |
| next | back to summary |
|---|---|
| pack-priv ChannelOutboundBuffer. | |
| pendingSize | back to summary |
|---|---|
| pack-priv int pendingSize | |
| progress | back to summary |
|---|---|
| pack-priv long progress | |
| promise | back to summary |
|---|---|
| pack-priv ChannelPromise promise | |
| RECYCLER | back to summary |
|---|---|
| private static final ObjectPool<ChannelOutboundBuffer. | |
| total | back to summary |
|---|---|
| pack-priv long total | |
| Entry | back to summary |
|---|---|
| private Entry(ObjectPool. | |
| cancel | back to summary |
|---|---|
| pack-priv int cancel() | |
| newInstance | back to summary |
|---|---|
| pack-priv static ChannelOutboundBuffer. | |
| unguardedRecycle | back to summary |
|---|---|
| pack-priv void unguardedRecycle() | |
| unguardedRecycleAndGetNext | back to summary |
|---|---|
| pack-priv ChannelOutboundBuffer. | |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | processMessage(Object msg)
Will be called for each flushed message until it either there are no more flushed messages or this
method returns |
| processMessage | back to summary |
|---|---|
| public boolean processMessage(Object msg) throws Exception Will be called for each flushed message until it either there are no more flushed messages or this
method returns | |