Home / Function/ minChunkShouldBeAllocatedPerStream() — netty Function Reference

minChunkShouldBeAllocatedPerStream() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  9910f283_ee16_3c47_92af_fc5bf8c8409e["minChunkShouldBeAllocatedPerStream()"]
  67b7550d_3bc6_4a2b_6b2f_618af35d6df8["WeightedFairQueueByteDistributorTest"]
  9910f283_ee16_3c47_92af_fc5bf8c8409e -->|defined in| 67b7550d_3bc6_4a2b_6b2f_618af35d6df8
  11b51d3d_8188_9502_be8f_cc1ca56136d9["write()"]
  9910f283_ee16_3c47_92af_fc5bf8c8409e -->|calls| 11b51d3d_8188_9502_be8f_cc1ca56136d9
  fa4d7172_24a5_f6ad_635f_9c2cba8fd926["captureWrites()"]
  9910f283_ee16_3c47_92af_fc5bf8c8409e -->|calls| fa4d7172_24a5_f6ad_635f_9c2cba8fd926
  7bda6a25_cd2a_2145_1a6b_a3c3169cec22["verifyWrite()"]
  9910f283_ee16_3c47_92af_fc5bf8c8409e -->|calls| 7bda6a25_cd2a_2145_1a6b_a3c3169cec22
  style 9910f283_ee16_3c47_92af_fc5bf8c8409e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorTest.java lines 183–211

    @Test
    public void minChunkShouldBeAllocatedPerStream() throws Http2Exception {
        // Re-assign weights.
        setPriority(STREAM_A, 0, (short) 50, false);
        setPriority(STREAM_B, 0, (short) 200, false);
        setPriority(STREAM_C, STREAM_A, (short) 100, false);
        setPriority(STREAM_D, STREAM_A, (short) 100, false);

        // Update the streams.
        initState(STREAM_A, ALLOCATION_QUANTUM, true);
        initState(STREAM_B, ALLOCATION_QUANTUM, true);
        initState(STREAM_C, ALLOCATION_QUANTUM, true);
        initState(STREAM_D, ALLOCATION_QUANTUM, true);

        // Only write 3 * chunkSize, so that we'll only write to the first 3 streams.
        int written = 3 * ALLOCATION_QUANTUM;
        assertTrue(write(written));
        assertEquals(ALLOCATION_QUANTUM, captureWrites(STREAM_A));
        assertEquals(ALLOCATION_QUANTUM, captureWrites(STREAM_B));
        assertEquals(ALLOCATION_QUANTUM, captureWrites(STREAM_C));
        verifyWrite(atMost(1), STREAM_D, 0);

        // Now write again and verify that the last stream is written to.
        assertFalse(write(ALLOCATION_QUANTUM));
        assertEquals(ALLOCATION_QUANTUM, captureWrites(STREAM_A));
        assertEquals(ALLOCATION_QUANTUM, captureWrites(STREAM_B));
        assertEquals(ALLOCATION_QUANTUM, captureWrites(STREAM_C));
        assertEquals(ALLOCATION_QUANTUM, captureWrites(STREAM_D));
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free