EventLoop which uses epoll under the covers. Only works on Linux!
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private static final long | |
| private final IntObjectMap | |
| private NativeDatagramPacketArray | |
| private static final long | |
| private FileDescriptor | |
| private FileDescriptor | |
| private final EpollEventArray | |
| private volatile int | |
| private IovArray | |
| private static final InternalLogger | |
| private static final long | |
| private final AtomicLong | |
| private static final long | |
| private boolean | |
| private final IntSupplier | |
| private final SelectStrategy | |
| private FileDescriptor |
| Access | Constructor and Description |
|---|---|
| pack-priv | EpollEventLoop(EventLoopGroup parent, Executor executor, int maxEvents, SelectStrategy strategy, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| protected boolean | afterScheduledTaskSubmitted(long deadlineNanos)
Overrides io. beforeScheduledTaskSubmitted(long).
|
| protected boolean | beforeScheduledTaskSubmitted(long
deadline of the to-be-scheduled task
relative to deadlineNanos)AbstractScheduledEventExecutor#getCurrentTimeNanos()Overrides io. EventExecutor threads prior to scheduled task submission.
|
| pack-priv NativeDatagramPacketArray | cleanDatagramPacketArray()
Return a cleared |
| pack-priv IovArray | |
| protected void | cleanup()
Overrides io. |
| private void | |
| public void | closeFileDescriptors()
This method is intended for use by process checkpoint/restore integration, such as OpenJDK CRaC. |
| private int | |
| private long | |
| private int | |
| private int | |
| private int | |
| public int | |
| pack-priv void | |
| pack-priv void | |
| private static Queue | |
| protected Queue | newTaskQueue(int maxPendingTasks)
Overrides io. Queue which will holds the tasks to execute.
|
| private static Queue | |
| public void | openFileDescriptors()
This method is intended for use by a process checkpoint/restore integration, such as OpenJDK CRaC. |
| private boolean | |
| public int | registeredChannels()
Overrides io. Channels registered with this EventLoop or -1
if operation is not supported.
|
| public Iterator | |
| pack-priv void | |
| protected void | run()
Implements abstract io. taskQueue
|
| public void | setIoRatio(int ioRatio)
Sets the percentage of the desired amount of time spent for I/O in the event loop. |
| protected void |
| allowGrowing | back to summary |
|---|---|
| private final boolean allowGrowing | |
| AWAKE | back to summary |
|---|---|
| private static final long AWAKE | |
| channels | back to summary |
|---|---|
| private final IntObjectMap<AbstractEpollChannel> channels | |
| datagramPacketArray | back to summary |
|---|---|
| private NativeDatagramPacketArray datagramPacketArray | |
| EPOLL_WAIT_MILLIS_THRESHOLD | back to summary |
|---|---|
| private static final long EPOLL_WAIT_MILLIS_THRESHOLD | |
| epollFd | back to summary |
|---|---|
| private FileDescriptor epollFd | |
| eventFd | back to summary |
|---|---|
| private FileDescriptor eventFd | |
| events | back to summary |
|---|---|
| private final EpollEventArray events | |
| ioRatio | back to summary |
|---|---|
| private volatile int ioRatio | |
| iovArray | back to summary |
|---|---|
| private IovArray iovArray | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger Hides io. | |
| MAX_SCHEDULED_TIMERFD_NS | back to summary |
|---|---|
| private static final long MAX_SCHEDULED_TIMERFD_NS | |
| nextWakeupNanos | back to summary |
|---|---|
| private final AtomicLong nextWakeupNanos | |
| NONE | back to summary |
|---|---|
| private static final long NONE | |
| pendingWakeup | back to summary |
|---|---|
| private boolean pendingWakeup | |
| selectNowSupplier | back to summary |
|---|---|
| private final IntSupplier selectNowSupplier | |
| selectStrategy | back to summary |
|---|---|
| private final SelectStrategy selectStrategy | |
| timerFd | back to summary |
|---|---|
| private FileDescriptor timerFd | |
| EpollEventLoop | back to summary |
|---|---|
| pack-priv EpollEventLoop(EventLoopGroup parent, Executor executor, int maxEvents, SelectStrategy strategy, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory) | |
| add | back to summary |
|---|---|
| pack-priv void add(AbstractEpollChannel ch) throws IOException Register the given epoll with this | |
| afterScheduledTaskSubmitted | back to summary |
|---|---|
| protected boolean afterScheduledTaskSubmitted(long deadlineNanos) Overrides io. Doc from io. See
| |
| beforeScheduledTaskSubmitted | back to summary |
|---|---|
| protected boolean beforeScheduledTaskSubmitted(long deadlineNanos) Overrides io. Doc from io. Called from arbitrary non-
If
| |
| cleanDatagramPacketArray | back to summary |
|---|---|
| pack-priv NativeDatagramPacketArray cleanDatagramPacketArray() Return a cleared | |
| cleanIovArray | back to summary |
|---|---|
| pack-priv IovArray cleanIovArray() Return a cleared | |
| cleanup | back to summary |
|---|---|
| protected void cleanup() Overrides io. Doc from io. Do nothing, sub-classes may override
| |
| closeAll | back to summary |
|---|---|
| private void closeAll() | |
| closeFileDescriptors | back to summary |
|---|---|
| public void closeFileDescriptors() This method is intended for use by process checkpoint/restore integration, such as OpenJDK CRaC. It's up to the caller to ensure that there is no concurrent use of the FDs while these are closed, e.g. by blocking the executor.
| |
| epollBusyWait | back to summary |
|---|---|
| private int epollBusyWait() throws IOException | |
| epollWait | back to summary |
|---|---|
| private long epollWait(long deadlineNanos) throws IOException | |
| epollWaitNoTimerChange | back to summary |
|---|---|
| private int epollWaitNoTimerChange() throws IOException | |
| epollWaitNow | back to summary |
|---|---|
| private int epollWaitNow() throws IOException | |
| epollWaitTimeboxed | back to summary |
|---|---|
| private int epollWaitTimeboxed() throws IOException | |
| getIoRatio | back to summary |
|---|---|
| public int getIoRatio() Returns the percentage of the desired amount of time spent for I/O in the event loop. | |
| handleLoopException | back to summary |
|---|---|
| pack-priv void handleLoopException(Throwable t) Visible only for testing! | |
| modify | back to summary |
|---|---|
| pack-priv void modify(AbstractEpollChannel ch) throws IOException The flags of the given epoll was modified so update the registration | |
| newTaskQueue | back to summary |
|---|---|
| private static Queue | |
| newTaskQueue | back to summary |
|---|---|
| protected Queue Overrides io. Doc from io. Create a new
| |
| newTaskQueue0 | back to summary |
|---|---|
| private static Queue | |
| openFileDescriptors | back to summary |
|---|---|
| public void openFileDescriptors() This method is intended for use by a process checkpoint/restore integration, such as OpenJDK CRaC.
| |
| processReady | back to summary |
|---|---|
| private boolean processReady(EpollEventArray events, int ready) | |
| registeredChannels | back to summary |
|---|---|
| public int registeredChannels() Overrides io. Doc from io. Returns the number of
| |
| registeredChannelsIterator | back to summary |
|---|---|
| public Iterator Overrides io.
| |
| remove | back to summary |
|---|---|
| pack-priv void remove(AbstractEpollChannel ch) throws IOException Deregister the given epoll from this | |
| run | back to summary |
|---|---|
| protected void run() Implements abstract io. Doc from io. Run the tasks in the
| |
| setIoRatio | back to summary |
|---|---|
| public void setIoRatio(int ioRatio) Sets the percentage of the desired amount of time spent for I/O in the event loop. The default value is
| |
| wakeup | back to summary |
|---|---|
| protected void wakeup(boolean inEventLoop) Overrides io.
| |