Top Description Fields Constructors Methods
io.netty.incubator.channel.uring

public final Class IOUringEventLoop

extends SingleThreadEventLoop
Class Inheritance
Imports
io.netty.channel.EventLoopTaskQueueFactory, .SingleThreadEventLoop, io.netty.channel.unix.Errors, .FileDescriptor, io.netty.util.collection.IntObjectHashMap, .IntObjectMap, io.netty.util.concurrent.RejectedExecutionHandler, io.netty.util.internal.PlatformDependent, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.io.IOException, java.util.Queue, java.util.concurrent.Executor, .RejectedExecutionException, java.util.concurrent.atomic.AtomicLong

An io.netty.channel.EventLoop that uses IO_URING.

Field Summary

Modifier and TypeField and Description
private static final long
private final IOUringCompletionQueueCallback
private final IntObjectMap<AbstractIOUringChannel>
private final FileDescriptor
private final long
private final byte[]
private final byte[]
private static final InternalLogger
private final AtomicLong
private static final long
private boolean
private long
private short
prevTimeoutGeneration

This is a "generation" counter that is passed to addTimeout.

private final RingBuffer
private final Runnable
Inherited from io.netty.channel.SingleThreadEventLoop:
DEFAULT_MAX_PENDING_TASKS

Constructor Summary

AccessConstructor and Description
pack-priv
IOUringEventLoop(IOUringEventLoopGroup parent, Executor executor, int ringSize, int iosqeAsyncThreshold, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory queueFactory)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
private void
protected void
cleanup()

Overrides io.netty.util.concurrent.SingleThreadEventExecutor.cleanup.

Do nothing, sub-classes may override
private void
pack-priv RingBuffer
private void
handle(int fd, int res, int flags, byte op, short data)

private void
pack-priv void
handleLoopException(Throwable t)

Visible only for testing!

private void
handlePollAdd(AbstractIOUringChannel channel, int res, int pollMask)

private void
handleRead(AbstractIOUringChannel channel, int res, int data)

private void
handleWrite(AbstractIOUringChannel channel, int res, int data)

pack-priv byte[]
inet4AddressArray()

byte[] that can be used as temporary storage to encode the ipv4 address

pack-priv byte[]
inet6AddressArray()

byte[] that can be used as temporary storage to encode the ipv6 address

private static Queue<Runnable>
protected Queue<Runnable>
newTaskQueue(int maxPendingTasks)

Overrides io.netty.util.concurrent.SingleThreadEventExecutor.newTaskQueue.

Create a new Queue which will holds the tasks to execute.
private static Queue<Runnable>
newTaskQueue0(int maxPendingTasks)

pack-priv void
protected void
run()

Implements abstract io.netty.util.concurrent.SingleThreadEventExecutor.run.

Run the tasks in the taskQueue
public void
submitIO()

Submit the IO so the kernel can process it.

protected void
Inherited from io.netty.channel.SingleThreadEventLoop:
afterRunningAllTasksexecuteAfterEventLoopIterationhasTasksnextparentpendingTasksregisterregisterregisterregisteredChannelsregisteredChannelsIterator

Field Detail

AWAKEback to summary
private static final long AWAKE
callbackback to summary
private final IOUringCompletionQueueCallback callback
channelsback to summary
private final IntObjectMap<AbstractIOUringChannel> channels
eventfdback to summary
private final FileDescriptor eventfd
eventfdReadBufback to summary
private final long eventfdReadBuf
inet4AddressArrayback to summary
private final byte[] inet4AddressArray
inet6AddressArrayback to summary
private final byte[] inet6AddressArray
loggerback to summary
private static final InternalLogger logger

Hides io.netty.util.concurrent.SingleThreadEventExecutor.logger.

nextWakeupNanosback to summary
private final AtomicLong nextWakeupNanos
NONEback to summary
private static final long NONE
pendingWakeupback to summary
private boolean pendingWakeup
prevDeadlineNanosback to summary
private long prevDeadlineNanos
prevTimeoutGenerationback to summary
private short prevTimeoutGeneration

This is a "generation" counter that is passed to addTimeout. It ensures that the expiry of a previous timeout doesn't make us think the current timeout has expired, which could lead to wrongly not removing the current timeout when it's adjusted again.

ringBufferback to summary
private final RingBuffer ringBuffer
submitIOTaskback to summary
private final Runnable submitIOTask

Constructor Detail

IOUringEventLoopback to summary
pack-priv IOUringEventLoop(IOUringEventLoopGroup parent, Executor executor, int ringSize, int iosqeAsyncThreshold, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory queueFactory)

Method Detail

addback to summary
pack-priv void add(AbstractIOUringChannel ch)
addEventFdReadback to summary
private void addEventFdRead(IOUringSubmissionQueue submissionQueue)
cleanupback to summary
protected void cleanup()

Overrides io.netty.util.concurrent.SingleThreadEventExecutor.cleanup.

Doc from io.netty.util.concurrent.SingleThreadEventExecutor.cleanup.

Do nothing, sub-classes may override

Annotations
@Override
closeAllback to summary
private void closeAll()
getRingBufferback to summary
pack-priv RingBuffer getRingBuffer()
handleback to summary
private void handle(int fd, int res, int flags, byte op, short data)
handleConnectback to summary
private void handleConnect(AbstractIOUringChannel channel, int res)
handleLoopExceptionback to summary
pack-priv void handleLoopException(Throwable t)

Visible only for testing!

handlePollAddback to summary
private void handlePollAdd(AbstractIOUringChannel channel, int res, int pollMask)
handleReadback to summary
private void handleRead(AbstractIOUringChannel channel, int res, int data)
handleWriteback to summary
private void handleWrite(AbstractIOUringChannel channel, int res, int data)
inet4AddressArrayback to summary
pack-priv byte[] inet4AddressArray()

byte[] that can be used as temporary storage to encode the ipv4 address

inet6AddressArrayback to summary
pack-priv byte[] inet6AddressArray()

byte[] that can be used as temporary storage to encode the ipv6 address

newTaskQueueback to summary
private static Queue<Runnable> newTaskQueue(EventLoopTaskQueueFactory queueFactory)
newTaskQueueback to summary
protected Queue<Runnable> newTaskQueue(int maxPendingTasks)

Overrides io.netty.util.concurrent.SingleThreadEventExecutor.newTaskQueue.

Doc from io.netty.util.concurrent.SingleThreadEventExecutor.newTaskQueue.

Create a new Queue which will holds the tasks to execute. This default implementation will return a LinkedBlockingQueue but if your sub-class of SingleThreadEventExecutor will not do any blocking calls on the this Queue it may make sense to @Override this and return some more performant implementation that does not support blocking operations at all.

Annotations
@Override
newTaskQueue0back to summary
private static Queue<Runnable> newTaskQueue0(int maxPendingTasks)
removeback to summary
pack-priv void remove(AbstractIOUringChannel ch)
runback to summary
protected void run()

Implements abstract io.netty.util.concurrent.SingleThreadEventExecutor.run.

Doc from io.netty.util.concurrent.SingleThreadEventExecutor.run.

Run the tasks in the taskQueue

Annotations
@Override
submitIOback to summary
public void submitIO()

Submit the IO so the kernel can process it. This method can be called to "force" the submission (before it is submitted by netty itself).

wakeupback to summary
protected void wakeup(boolean inEventLoop)

Overrides io.netty.util.concurrent.SingleThreadEventExecutor.wakeup.

Annotations
@Override