Home / Function/ pushId() — netty Function Reference

pushId() — netty Function Reference

Architecture documentation for the pushId() function in DnsQueryIdSpace.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  cf295d23_8f39_8124_5d0d_2b95f67a081b["pushId()"]
  111240bc_7647_f4bc_5270_6c732c4ba85a["DnsQueryIdRange"]
  cf295d23_8f39_8124_5d0d_2b95f67a081b -->|defined in| 111240bc_7647_f4bc_5270_6c732c4ba85a
  20a7aee7_30f1_992d_adbd_6eb3a0f5c471["pushId()"]
  20a7aee7_30f1_992d_adbd_6eb3a0f5c471 -->|calls| cf295d23_8f39_8124_5d0d_2b95f67a081b
  28a1a002_2028_b30d_c464_69be19a4601e["DnsQueryIdRange()"]
  28a1a002_2028_b30d_c464_69be19a4601e -->|calls| cf295d23_8f39_8124_5d0d_2b95f67a081b
  20a7aee7_30f1_992d_adbd_6eb3a0f5c471["pushId()"]
  cf295d23_8f39_8124_5d0d_2b95f67a081b -->|calls| 20a7aee7_30f1_992d_adbd_6eb3a0f5c471
  style cf295d23_8f39_8124_5d0d_2b95f67a081b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

resolver-dns/src/main/java/io/netty/resolver/dns/DnsQueryIdSpace.java lines 175–192

        void pushId(int id) {
            if (count == ids.length) {
                throw new IllegalStateException("overflow");
            }
            assert id <= startId + ids.length && id >= startId;
            // pick a slot for our index, and whatever was in that slot before will get moved to the tail.
            Random random = ThreadLocalRandom.current();
            int insertionPosition = random.nextInt(count + 1);
            short moveId = ids[insertionPosition];
            short insertId = (short) id;

            // Assert that the ids are different or its the same index.
            assert moveId != insertId || insertionPosition == count;

            ids[count] = moveId;
            ids[insertionPosition] = insertId;
            count++;
        }

Subdomains

Calls

Frequently Asked Questions

What does pushId() do?
pushId() is a function in the netty codebase, defined in resolver-dns/src/main/java/io/netty/resolver/dns/DnsQueryIdSpace.java.
Where is pushId() defined?
pushId() is defined in resolver-dns/src/main/java/io/netty/resolver/dns/DnsQueryIdSpace.java at line 175.
What does pushId() call?
pushId() calls 1 function(s): pushId.
What calls pushId()?
pushId() is called by 2 function(s): DnsQueryIdRange, pushId.

Analyze Your Own Codebase

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

Try Supermodel Free