Package io.netty.incubator.channel.uring
Class IOUringEventLoop
java.lang.Object
java.util.concurrent.AbstractExecutorService
io.netty.util.concurrent.AbstractEventExecutor
io.netty.util.concurrent.AbstractScheduledEventExecutor
io.netty.util.concurrent.SingleThreadEventExecutor
io.netty.channel.SingleThreadEventLoop
io.netty.incubator.channel.uring.IOUringEventLoop
- All Implemented Interfaces:
io.netty.channel.EventLoop,io.netty.channel.EventLoopGroup,io.netty.util.concurrent.EventExecutor,io.netty.util.concurrent.EventExecutorGroup,io.netty.util.concurrent.OrderedEventExecutor,Iterable<io.netty.util.concurrent.EventExecutor>,Executor,ExecutorService,ScheduledExecutorService
public final class IOUringEventLoop
extends io.netty.channel.SingleThreadEventLoop
An
EventLoop that uses IO_URING.-
Nested Class Summary
Nested classes/interfaces inherited from class io.netty.channel.SingleThreadEventLoop
io.netty.channel.SingleThreadEventLoop.ChannelsReadOnlyIterator<T extends io.netty.channel.Channel>Nested classes/interfaces inherited from class io.netty.util.concurrent.SingleThreadEventExecutor
io.netty.util.concurrent.SingleThreadEventExecutor.NonWakeupRunnableNested classes/interfaces inherited from class io.netty.util.concurrent.AbstractEventExecutor
io.netty.util.concurrent.AbstractEventExecutor.LazyRunnable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate final IOUringCompletionQueueCallbackprivate final io.netty.util.collection.IntObjectMap<AbstractIOUringChannel> private final io.netty.channel.unix.FileDescriptorprivate final longprivate final byte[]private final byte[]private static final io.netty.util.internal.logging.InternalLoggerprivate final AtomicLongprivate static final longprivate booleanprivate longprivate shortThis is a "generation" counter that is passed to addTimeout.private final RingBufferprivate final RunnableFields inherited from class io.netty.channel.SingleThreadEventLoop
DEFAULT_MAX_PENDING_TASKS -
Constructor Summary
ConstructorsConstructorDescriptionIOUringEventLoop(IOUringEventLoopGroup parent, Executor executor, int ringSize, int iosqeAsyncThreshold, io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler, io.netty.channel.EventLoopTaskQueueFactory queueFactory) -
Method Summary
Modifier and TypeMethodDescription(package private) voidprivate voidaddEventFdRead(IOUringSubmissionQueue submissionQueue) protected voidcleanup()private voidcloseAll()(package private) RingBufferprivate voidhandle(int fd, int res, int flags, byte op, short data) private voidhandle0(int fd, int res, int flags, byte op, short data) private voidhandleConnect(AbstractIOUringChannel channel, int res) (package private) voidVisible only for testing!private voidhandlePollAdd(AbstractIOUringChannel channel, int res, int pollMask) private voidhandleRead(AbstractIOUringChannel channel, int res, int data) private voidhandleWrite(AbstractIOUringChannel channel, int res, int data) (package private) byte[]byte[]that can be used as temporary storage to encode the ipv4 address(package private) byte[]byte[]that can be used as temporary storage to encode the ipv6 addressnewTaskQueue(int maxPendingTasks) newTaskQueue(io.netty.channel.EventLoopTaskQueueFactory queueFactory) newTaskQueue0(int maxPendingTasks) (package private) voidprotected voidrun()voidsubmitIO()Submit the IO so the kernel can process it.protected voidwakeup(boolean inEventLoop) Methods inherited from class io.netty.channel.SingleThreadEventLoop
afterRunningAllTasks, executeAfterEventLoopIteration, hasTasks, next, parent, pendingTasks, register, register, register, registeredChannels, registeredChannelsIteratorMethods inherited from class io.netty.util.concurrent.SingleThreadEventExecutor
addShutdownHook, addTask, awaitTermination, confirmShutdown, deadlineNanos, delayNanos, execute, inEventLoop, interruptThread, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isShuttingDown, isTerminated, lazyExecute, newTaskQueue, peekTask, pollTask, pollTaskFrom, reject, reject, removeShutdownHook, removeTask, runAllTasks, runAllTasks, runAllTasksFrom, runScheduledAndExecutorTasks, shutdown, shutdownGracefully, takeTask, terminationFuture, threadProperties, updateLastExecutionTime, wakesUpForTaskMethods inherited from class io.netty.util.concurrent.AbstractScheduledEventExecutor
afterScheduledTaskSubmitted, beforeScheduledTaskSubmitted, cancelScheduledTasks, deadlineToDelayNanos, getCurrentTimeNanos, hasScheduledTasks, initialNanoTime, nanoTime, nextScheduledTaskDeadlineNanos, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, validateScheduledMethods inherited from class io.netty.util.concurrent.AbstractEventExecutor
inEventLoop, iterator, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newTaskFor, newTaskFor, runTask, safeExecute, shutdownGracefully, shutdownNow, submit, submit, submitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.util.concurrent.EventExecutor
inEventLoop, inEventLoop, newFailedFuture, newProgressivePromise, newPromise, newSucceededFutureMethods inherited from interface io.netty.util.concurrent.EventExecutorGroup
isShuttingDown, iterator, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownGracefully, shutdownNow, submit, submit, submit, terminationFutureMethods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminatedMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
logger
private static final io.netty.util.internal.logging.InternalLogger logger -
eventfdReadBuf
private final long eventfdReadBuf -
channels
-
ringBuffer
-
AWAKE
private static final long AWAKE- See Also:
-
NONE
private static final long NONE- See Also:
-
nextWakeupNanos
-
eventfd
private final io.netty.channel.unix.FileDescriptor eventfd -
inet4AddressArray
private final byte[] inet4AddressArray -
inet6AddressArray
private final byte[] inet6AddressArray -
callback
-
submitIOTask
-
prevDeadlineNanos
private long prevDeadlineNanos -
prevTimeoutGeneration
private short prevTimeoutGenerationThis 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. -
pendingWakeup
private boolean pendingWakeup
-
-
Constructor Details
-
IOUringEventLoop
IOUringEventLoop(IOUringEventLoopGroup parent, Executor executor, int ringSize, int iosqeAsyncThreshold, io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler, io.netty.channel.EventLoopTaskQueueFactory queueFactory)
-
-
Method Details
-
submitIO
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). -
newTaskQueue
-
newTaskQueue
- Overrides:
newTaskQueuein classio.netty.util.concurrent.SingleThreadEventExecutor
-
newTaskQueue0
-
add
-
remove
-
closeAll
private void closeAll() -
run
protected void run()- Specified by:
runin classio.netty.util.concurrent.SingleThreadEventExecutor
-
handleLoopException
Visible only for testing! -
handle
private void handle(int fd, int res, int flags, byte op, short data) -
handle0
private void handle0(int fd, int res, int flags, byte op, short data) -
handleRead
-
handleWrite
-
handlePollAdd
-
addEventFdRead
-
handleConnect
-
cleanup
protected void cleanup()- Overrides:
cleanupin classio.netty.util.concurrent.SingleThreadEventExecutor
-
getRingBuffer
RingBuffer getRingBuffer() -
wakeup
protected void wakeup(boolean inEventLoop) - Overrides:
wakeupin classio.netty.util.concurrent.SingleThreadEventExecutor
-
inet4AddressArray
byte[] inet4AddressArray()byte[]that can be used as temporary storage to encode the ipv4 address -
inet6AddressArray
byte[] inet6AddressArray()byte[]that can be used as temporary storage to encode the ipv6 address
-