Home / Class/ IoUringIoHandlerConfig Class — netty Architecture

IoUringIoHandlerConfig Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  92925609_b765_6463_2e57_25f6a2cca36b["IoUringIoHandlerConfig"]
  2558b227_72dc_eb63_8e1d_cc20daa8bb2e["IoUringIoHandlerConfig.java"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|defined in| 2558b227_72dc_eb63_8e1d_cc20daa8bb2e
  cf9838b4_998c_f0f7_f4a3_d4f2e5ff4a58["IoUringIoHandlerConfig()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| cf9838b4_998c_f0f7_f4a3_d4f2e5ff4a58
  f3cf26ca_8362_ad07_27c2_71fc969035c1["getRingSize()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| f3cf26ca_8362_ad07_27c2_71fc969035c1
  98dde5ca_3b70_768a_4648_aaed304f9a9c["getCqSize()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| 98dde5ca_3b70_768a_4648_aaed304f9a9c
  0a861505_77c2_bf38_a66b_56c09090cc4d["getMaxBoundedWorker()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| 0a861505_77c2_bf38_a66b_56c09090cc4d
  ca7deeb7_c121_41f5_6fc8_7c878c4a6bca["getMaxUnboundedWorker()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| ca7deeb7_c121_41f5_6fc8_7c878c4a6bca
  331e8416_ff71_55b0_7bfa_8034da61b145["checkCqSize()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| 331e8416_ff71_55b0_7bfa_8034da61b145
  d164749d_006e_c6e7_0fa2_e0e3d92493e2["getBufferRingConfigs()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| d164749d_006e_c6e7_0fa2_e0e3d92493e2
  be9db36d_d408_6c32_7438_0ac031fac9f5["needRegisterIowqMaxWorker()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| be9db36d_d408_6c32_7438_0ac031fac9f5
  281d9e24_5d9b_be3e_af94_fdc4d60dd8bf["needSetupCqeSize()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| 281d9e24_5d9b_be3e_af94_fdc4d60dd8bf
  0486e4c3_fba6_c339_63ec_54ce0c82f0db["getInternBufferRingConfigs()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| 0486e4c3_fba6_c339_63ec_54ce0c82f0db
  d472faaa_0f87_81b6_19a7_971b1ec99bbd["singleIssuer()"]
  92925609_b765_6463_2e57_25f6a2cca36b -->|method| d472faaa_0f87_81b6_19a7_971b1ec99bbd

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringIoHandlerConfig.java lines 104–287

public final class IoUringIoHandlerConfig {

    private int ringSize = IoUring.DEFAULT_RING_SIZE;
    private int cqSize = IoUring.DEFAULT_CQ_SIZE;
    private int maxBoundedWorker;
    private int maxUnboundedWorker;
    private Set<IoUringBufferRingConfig> bufferRingConfigs;
    private boolean singleIssuer = true;

    public IoUringIoHandlerConfig() { }

    private IoUringIoHandlerConfig(IoUringIoHandlerConfig config) {
        this.ringSize = config.ringSize;
        this.cqSize = config.cqSize;
        this.maxBoundedWorker = config.maxBoundedWorker;
        this.maxUnboundedWorker = config.maxUnboundedWorker;
        this.bufferRingConfigs = config.bufferRingConfigs == null ? null : new HashSet<>(config.bufferRingConfigs);
        this.singleIssuer = config.singleIssuer;
    }
    /**
     * Return the ring size of the io_uring instance.
     * @return the ring size of the io_uring instance.
     */
    public int getRingSize() {
        return ringSize;
    }

    /**
     * Return the size of the io_uring cqe.
     * @return the cq size of the io_uring.
     */
    public int getCqSize() {
        return cqSize;
    }

    /**
     * Return the maximum number of bounded iowq worker threads.
     * @return the maximum number of bounded iowq worker threads.
     */
    public int getMaxBoundedWorker() {
        return maxBoundedWorker;
    }

    /**
     * Return the maximum number of unbounded iowq worker threads.
     * @return the maximum number of unbounded iowq worker threads.
     */
    public int getMaxUnboundedWorker() {
        return maxUnboundedWorker;
    }

    /**
     * Set the ring size of the io_uring instance.
     * @param ringSize the ring size of the io_uring instance.
     * @return reference to this, so the API can be used fluently
     */
    public IoUringIoHandlerConfig setRingSize(int ringSize) {
        this.ringSize = ObjectUtil.checkPositive(ringSize, "ringSize");
        return this;
    }

    /**
     * Set the size of the io_uring cqe.
     * @param cqSize the size of the io_uring cqe.
     * @throws IllegalArgumentException if cqSize is less than ringSize, or not a power of 2
     * @return reference to this, so the API can be used fluently
     */
    public IoUringIoHandlerConfig setCqSize(int cqSize) {
        ObjectUtil.checkPositive(cqSize, "cqSize");
        this.cqSize = checkCqSize(cqSize);
        return this;
    }

    private int checkCqSize(int cqSize) {
        if (cqSize < ringSize) {
            throw new IllegalArgumentException("cqSize must be greater than or equal to ringSize");
        }

        boolean isPowerOfTwo = Integer.bitCount(cqSize) == 1;
        if (!isPowerOfTwo) {
            throw new IllegalArgumentException("cqSize: " + cqSize + " (expected: power of 2)");

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free