Home / Function/ writeShouldPreferHighestWeight() — netty Function Reference

writeShouldPreferHighestWeight() — netty Function Reference

Architecture documentation for the writeShouldPreferHighestWeight() function in WeightedFairQueueByteDistributorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  509b0e8c_cc83_7e31_f836_9c5247aef861["writeShouldPreferHighestWeight()"]
  67b7550d_3bc6_4a2b_6b2f_618af35d6df8["WeightedFairQueueByteDistributorTest"]
  509b0e8c_cc83_7e31_f836_9c5247aef861 -->|defined in| 67b7550d_3bc6_4a2b_6b2f_618af35d6df8
  11b51d3d_8188_9502_be8f_cc1ca56136d9["write()"]
  509b0e8c_cc83_7e31_f836_9c5247aef861 -->|calls| 11b51d3d_8188_9502_be8f_cc1ca56136d9
  fa4d7172_24a5_f6ad_635f_9c2cba8fd926["captureWrites()"]
  509b0e8c_cc83_7e31_f836_9c5247aef861 -->|calls| fa4d7172_24a5_f6ad_635f_9c2cba8fd926
  style 509b0e8c_cc83_7e31_f836_9c5247aef861 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorTest.java lines 518–539

    @Test
    public void writeShouldPreferHighestWeight() throws Http2Exception {
        // Root the streams at the connection and assign weights.
        setPriority(STREAM_A, 0, (short) 50, false);
        setPriority(STREAM_B, 0, (short) 200, false);
        setPriority(STREAM_C, 0, (short) 100, false);
        setPriority(STREAM_D, 0, (short) 100, false);

        initState(STREAM_A, 1000, true);
        initState(STREAM_B, 1000, true);
        initState(STREAM_C, 1000, true);
        initState(STREAM_D, 1000, true);

        // Set allocation quantum to 1 so it is easier to see the ratio of total bytes written between each stream.
        distributor.allocationQuantum(1);
        assertTrue(write(1000));

        assertEquals(100, captureWrites(STREAM_A));
        assertEquals(450, captureWrites(STREAM_B));
        assertEquals(225, captureWrites(STREAM_C));
        assertEquals(225, captureWrites(STREAM_D));
    }

Domain

Subdomains

Frequently Asked Questions

What does writeShouldPreferHighestWeight() do?
writeShouldPreferHighestWeight() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorTest.java.
Where is writeShouldPreferHighestWeight() defined?
writeShouldPreferHighestWeight() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorTest.java at line 518.
What does writeShouldPreferHighestWeight() call?
writeShouldPreferHighestWeight() calls 2 function(s): captureWrites, write.

Analyze Your Own Codebase

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

Try Supermodel Free