Home / Function/ scheduleReadProviderBuffer() — netty Function Reference

scheduleReadProviderBuffer() — netty Function Reference

Architecture documentation for the scheduleReadProviderBuffer() function in AbstractIoUringStreamChannel.java from the netty codebase.

Function java Buffer Telemetry calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  fa8d19bc_1143_f4c3_84c4_ef07823cb9be["scheduleReadProviderBuffer()"]
  2ef046a1_16aa_1708_4ba7_113c9fa2862e["IoUringStreamUnsafe"]
  fa8d19bc_1143_f4c3_84c4_ef07823cb9be -->|defined in| 2ef046a1_16aa_1708_4ba7_113c9fa2862e
  59498236_2b4d_5c66_9f07_08c2b7375a6b["scheduleRead0()"]
  59498236_2b4d_5c66_9f07_08c2b7375a6b -->|calls| fa8d19bc_1143_f4c3_84c4_ef07823cb9be
  21fb1737_9ce6_a472_6c2b_0339632901d1["handleReadException()"]
  fa8d19bc_1143_f4c3_84c4_ef07823cb9be -->|calls| 21fb1737_9ce6_a472_6c2b_0339632901d1
  7684e1d1_c90a_3647_fca5_52c1485dbb4e["calculateRecvIoPrio()"]
  fa8d19bc_1143_f4c3_84c4_ef07823cb9be -->|calls| 7684e1d1_c90a_3647_fca5_52c1485dbb4e
  f3971f93_dbcb_2767_5244_f09d3a29db3d["calculateRecvFlags()"]
  fa8d19bc_1143_f4c3_84c4_ef07823cb9be -->|calls| f3971f93_dbcb_2767_5244_f09d3a29db3d
  style fa8d19bc_1143_f4c3_84c4_ef07823cb9be fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringStreamChannel.java lines 366–407

        private int scheduleReadProviderBuffer(IoUringBufferRing bufferRing, boolean first, boolean socketIsEmpty) {
            short bgId = bufferRing.bufferGroupId();
            try {
                boolean multishot = IoUring.isRecvMultishotEnabled();
                byte flags = (byte) Native.IOSQE_BUFFER_SELECT;
                short ioPrio;
                final int recvFlags;
                if (multishot) {
                    ioPrio = Native.IORING_RECV_MULTISHOT;
                    recvFlags = 0;
                } else {
                    // We should only use the calculate*() methods if this is not a multishot recv, as otherwise
                    // the would be applied until the multishot will be re-armed.
                    ioPrio = calculateRecvIoPrio(first, socketIsEmpty);
                    recvFlags = calculateRecvFlags(first);
                }
                if (IoUring.isRecvsendBundleEnabled()) {
                    // See https://github.com/axboe/liburing/wiki/
                    // What's-new-with-io_uring-in-6.10#add-support-for-sendrecv-bundles
                    ioPrio |= Native.IORING_RECVSEND_BUNDLE;
                }
                IoRegistration registration = registration();
                int fd = fd().intValue();
                IoUringIoOps ops = IoUringIoOps.newRecv(
                        fd, flags, ioPrio, recvFlags, 0,
                        0, nextOpsId(), bgId
                );
                readId = registration.submit(ops);
                readOpCode = Native.IORING_OP_RECV;
                if (readId == 0) {
                    return 0;
                }
                if (multishot) {
                    // Return -1 to signal we used multishot and so expect multiple recvComplete(...) calls.
                    return -1;
                }
                return 1;
            } catch (IllegalArgumentException illegalArgumentException) {
                this.handleReadException(pipeline(), null, illegalArgumentException, false, recvBufAllocHandle());
                return 0;
            }
        }

Domain

Subdomains

Called By

Frequently Asked Questions

What does scheduleReadProviderBuffer() do?
scheduleReadProviderBuffer() is a function in the netty codebase, defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringStreamChannel.java.
Where is scheduleReadProviderBuffer() defined?
scheduleReadProviderBuffer() is defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringStreamChannel.java at line 366.
What does scheduleReadProviderBuffer() call?
scheduleReadProviderBuffer() calls 3 function(s): calculateRecvFlags, calculateRecvIoPrio, handleReadException.
What calls scheduleReadProviderBuffer()?
scheduleReadProviderBuffer() is called by 1 function(s): scheduleRead0.

Analyze Your Own Codebase

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

Try Supermodel Free