Home / Class/ IoUring Class — netty Architecture

IoUring Class — netty Architecture

Architecture documentation for the IoUring class in IoUring.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d5cc81ed_1769_add2_2dd0_49927a1b119d["IoUring"]
  f6a960ea_6318_2fe2_76ab_8e1ddbf0d724["IoUring.java"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|defined in| f6a960ea_6318_2fe2_76ab_8e1ddbf0d724
  ed8acda2_034f_4daa_c898_8d0dfc91b2a5["isAvailable()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| ed8acda2_034f_4daa_c898_8d0dfc91b2a5
  3d64991a_576e_94d5_cc0e_0630b89ef734["isTcpFastOpenClientSideAvailable()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| 3d64991a_576e_94d5_cc0e_0630b89ef734
  0a7e58c3_fa4c_3949_6838_0f5012ec72b9["isTcpFastOpenServerSideAvailable()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| 0a7e58c3_fa4c_3949_6838_0f5012ec72b9
  0ed5c0b6_c81a_8cc2_8630_b518e48238e8["isCqeFSockNonEmptySupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| 0ed5c0b6_c81a_8cc2_8630_b518e48238e8
  c7f2fe83_c13f_338d_2867_f0a07408cc9b["isSpliceSupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| c7f2fe83_c13f_338d_2867_f0a07408cc9b
  374c8ec1_a1ea_e62b_dcda_cdd7f745afb4["isSendZcSupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| 374c8ec1_a1ea_e62b_dcda_cdd7f745afb4
  6bd9ffa4_0bfe_cc1d_565f_f86df3599336["isSendmsgZcSupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| 6bd9ffa4_0bfe_cc1d_565f_f86df3599336
  a6b26c43_d01e_b930_25a7_445b617b0f51["isAcceptNoWaitSupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| a6b26c43_d01e_b930_25a7_445b617b0f51
  11fc974c_ad1a_7bd0_d2cc_e0277686c8f6["isAcceptMultishotSupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| 11fc974c_ad1a_7bd0_d2cc_e0277686c8f6
  8246bea3_89f3_3a32_b40a_0183413cf122["isRecvMultishotSupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| 8246bea3_89f3_3a32_b40a_0183413cf122
  3dce65ea_9c55_0402_af1c_0266b638769a["isRecvsendBundleSupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| 3dce65ea_9c55_0402_af1c_0266b638769a
  f78c76fc_ded7_47b6_b66e_fad66ab49b1f["isPollAddMultishotSupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| f78c76fc_ded7_47b6_b66e_fad66ab49b1f
  515d1b49_c473_db4d_4849_220b6502de42["isRegisterIowqMaxWorkersSupported()"]
  d5cc81ed_1769_add2_2dd0_49927a1b119d -->|method| 515d1b49_c473_db4d_4849_220b6502de42

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUring.java lines 29–423

public final class IoUring {

    private static final Throwable UNAVAILABILITY_CAUSE;
    private static final boolean IORING_CQE_F_SOCK_NONEMPTY_SUPPORTED;
    private static final boolean IORING_SPLICE_SUPPORTED;
    private static final boolean IORING_SEND_ZC_SUPPORTED;
    private static final boolean IORING_SENDMSG_ZC_SUPPORTED;
    private static final boolean IORING_ACCEPT_NO_WAIT_SUPPORTED;
    private static final boolean IORING_ACCEPT_MULTISHOT_SUPPORTED;
    private static final boolean IORING_RECV_MULTISHOT_SUPPORTED;
    private static final boolean IORING_RECVSEND_BUNDLE_SUPPORTED;
    private static final boolean IORING_POLL_ADD_MULTISHOT_SUPPORTED;
    private static final boolean IORING_REGISTER_IOWQ_MAX_WORKERS_SUPPORTED;
    private static final boolean IORING_SETUP_SUBMIT_ALL_SUPPORTED;
    private static final boolean IORING_SETUP_CQE_MIXED_SUPPORTED;
    private static final boolean IORING_SETUP_CQ_SIZE_SUPPORTED;
    private static final boolean IORING_SETUP_SINGLE_ISSUER_SUPPORTED;
    private static final boolean IORING_SETUP_DEFER_TASKRUN_SUPPORTED;
    private static final boolean IORING_SETUP_NO_SQARRAY_SUPPORTED;
    private static final boolean IORING_REGISTER_BUFFER_RING_SUPPORTED;
    private static final boolean IORING_REGISTER_BUFFER_RING_INC_SUPPORTED;
    private static final boolean IORING_ACCEPT_MULTISHOT_ENABLED;
    private static final boolean IORING_RECV_MULTISHOT_ENABLED;
    private static final boolean IORING_RECVSEND_BUNDLE_ENABLED;
    private static final boolean IORING_POLL_ADD_MULTISHOT_ENABLED;
    static final int NUM_ELEMENTS_IOVEC;
    static final int DEFAULT_RING_SIZE;
    static final int DEFAULT_CQ_SIZE;
    static final int DISABLE_SETUP_CQ_SIZE = -1;

    private static final InternalLogger logger;

    static {
        logger = InternalLoggerFactory.getInstance(IoUring.class);
        Throwable cause = null;
        boolean socketNonEmptySupported = false;
        boolean spliceSupported = false;
        boolean sendZcSupported = false;
        boolean sendmsgZcSupported = false;
        boolean acceptSupportNoWait = false;
        boolean acceptMultishotSupported = false;
        boolean recvsendBundleSupported = false;
        boolean recvMultishotSupported = false;
        boolean pollAddMultishotSupported = false;
        boolean registerIowqWorkersSupported = false;
        boolean submitAllSupported = false;
        boolean cqeMixedSupported = false;
        boolean setUpCqSizeSupported = false;
        boolean singleIssuerSupported = false;
        boolean deferTaskrunSupported = false;
        boolean noSqarraySupported = false;
        boolean registerBufferRingSupported = false;
        boolean registerBufferRingIncSupported = false;
        int numElementsIoVec = 10;

        String kernelVersion = "[unknown]";
        try {
            if (SystemPropertyUtil.getBoolean("io.netty.transport.noNative", false)) {
                cause = new UnsupportedOperationException(
                        "Native transport was explicit disabled with -Dio.netty.transport.noNative=true");
            } else {
                kernelVersion = Native.kernelVersion();
                Native.checkKernelVersion(kernelVersion);
                if (PlatformDependent.javaVersion() >= 9) {
                    RingBuffer ringBuffer = null;
                    try {
                        ringBuffer = Native.createRingBuffer(1, 0);
                        if ((ringBuffer.features() & Native.IORING_FEAT_SUBMIT_STABLE) == 0) {
                            // This should only happen on kernels < 5.4 which we don't support anyway.
                            throw new UnsupportedOperationException("IORING_FEAT_SUBMIT_STABLE not supported!");
                        }
                        // IOV_MAX should be 1024 and an IOV is 16 bytes which means that by default we reserve around
                        // 160kb.
                        numElementsIoVec = SystemPropertyUtil.getInt(
                                "io.netty.iouring.numElementsIoVec", 10 * Limits.IOV_MAX);
                        Native.IoUringProbe ioUringProbe = Native.ioUringProbe(ringBuffer.fd());
                        Native.checkAllIOSupported(ioUringProbe);
                        socketNonEmptySupported = Native.isCqeFSockNonEmptySupported(ioUringProbe);
                        spliceSupported = Native.isSpliceSupported(ioUringProbe);
                        recvsendBundleSupported = (ringBuffer.features() & Native.IORING_FEAT_RECVSEND_BUNDLE) != 0;
                        sendZcSupported = Native.isSendZcSupported(ioUringProbe);

Frequently Asked Questions

What is the IoUring class?
IoUring is a class in the netty codebase, defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUring.java.
Where is IoUring defined?
IoUring is defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUring.java at line 29.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free