Home / Function/ lowestPrecedenceStateShouldBeDropped() — netty Function Reference

lowestPrecedenceStateShouldBeDropped() — netty Function Reference

Architecture documentation for the lowestPrecedenceStateShouldBeDropped() function in WeightedFairQueueByteDistributorDependencyTreeTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  7fd9f674_a3db_2f86_0b71_15955386dcef["lowestPrecedenceStateShouldBeDropped()"]
  f59fdba5_c411_919e_8d09_ef11c6679e0d["WeightedFairQueueByteDistributorDependencyTreeTest"]
  7fd9f674_a3db_2f86_0b71_15955386dcef -->|defined in| f59fdba5_c411_919e_8d09_ef11c6679e0d
  57fc268f_ff1d_75b5_06df_6fd94e9fd09c["setup()"]
  7fd9f674_a3db_2f86_0b71_15955386dcef -->|calls| 57fc268f_ff1d_75b5_06df_6fd94e9fd09c
  6db50b9d_1b80_9b58_97b2_d49cee054cf2["verifyLowestPrecedenceStateShouldBeDropped1()"]
  7fd9f674_a3db_2f86_0b71_15955386dcef -->|calls| 6db50b9d_1b80_9b58_97b2_d49cee054cf2
  c8f6e93b_c31a_89ce_423f_531a00454b3b["verifyLowestPrecedenceStateShouldBeDropped2()"]
  7fd9f674_a3db_2f86_0b71_15955386dcef -->|calls| c8f6e93b_c31a_89ce_423f_531a00454b3b
  8537bf7f_2577_20c4_2854_6149341f9b8f["verifyLowestPrecedenceStateShouldBeDropped3()"]
  7fd9f674_a3db_2f86_0b71_15955386dcef -->|calls| 8537bf7f_2577_20c4_2854_6149341f9b8f
  eed7221d_a530_923d_6d12_abd34e70614a["verifyLowestPrecedenceStateShouldBeDropped4()"]
  7fd9f674_a3db_2f86_0b71_15955386dcef -->|calls| eed7221d_a530_923d_6d12_abd34e70614a
  1a69a0da_361d_4ab8_3b2d_34800c18d5b7["verifyLowestPrecedenceStateShouldBeDropped5()"]
  7fd9f674_a3db_2f86_0b71_15955386dcef -->|calls| 1a69a0da_361d_4ab8_3b2d_34800c18d5b7
  style 7fd9f674_a3db_2f86_0b71_15955386dcef fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorDependencyTreeTest.java lines 271–314

    @Test
    public void lowestPrecedenceStateShouldBeDropped() throws Http2Exception {
        setup(3);

        short weight3 = MAX_WEIGHT;
        short weight5 = (short) (weight3 - 1);
        short weight7 = (short) (weight5 - 1);
        short weight9 = (short) (weight7 - 1);
        setPriority(3, connection.connectionStream().id(), weight3, true);
        setPriority(5, connection.connectionStream().id(), weight5, true);
        setPriority(7, connection.connectionStream().id(), weight7, false);
        assertEquals(0, connection.numActiveStreams());
        verifyLowestPrecedenceStateShouldBeDropped1(weight3, weight5, weight7);

        // Attempt to create a new item in the dependency tree but the maximum amount of "state only" streams is meet
        // so a stream will have to be dropped. Currently the new stream is the lowest "precedence" so it is dropped.
        setPriority(9, 3, weight9, false);
        assertEquals(0, connection.numActiveStreams());
        verifyLowestPrecedenceStateShouldBeDropped1(weight3, weight5, weight7);

        // Set the priority for stream 9 such that its depth in the dependency tree is numerically lower than stream 3,
        // and therefore the dependency state associated with stream 3 will be dropped.
        setPriority(9, 5, weight9, true);
        verifyLowestPrecedenceStateShouldBeDropped2(weight9, weight5, weight7);

        // Test that stream which has been activated is lower priority than other streams that have not been activated.
        Http2Stream streamA = connection.local().createStream(5, false);
        streamA.close();
        verifyLowestPrecedenceStateShouldBeDropped2(weight9, weight5, weight7);

        // Stream 3 (hasn't been opened) should result in stream 5 being dropped.
        // dropping stream 5 will distribute its weight to children (only 9)
        setPriority(3, 9, weight3, false);
        verifyLowestPrecedenceStateShouldBeDropped3(weight3, weight7, weight5);

        // Stream 5's state has been discarded so we should be able to re-insert this state.
        setPriority(5, 0, weight5, false);
        verifyLowestPrecedenceStateShouldBeDropped4(weight5, weight7, weight5);

        // All streams are at the same level, so stream ID should be used to drop the numeric lowest valued stream.
        short weight11 = (short) (weight9 - 1);
        setPriority(11, 0, weight11, false);
        verifyLowestPrecedenceStateShouldBeDropped5(weight7, weight5, weight11);
    }

Domain

Subdomains

Frequently Asked Questions

What does lowestPrecedenceStateShouldBeDropped() do?
lowestPrecedenceStateShouldBeDropped() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorDependencyTreeTest.java.
Where is lowestPrecedenceStateShouldBeDropped() defined?
lowestPrecedenceStateShouldBeDropped() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorDependencyTreeTest.java at line 271.
What does lowestPrecedenceStateShouldBeDropped() call?
lowestPrecedenceStateShouldBeDropped() calls 6 function(s): setup, verifyLowestPrecedenceStateShouldBeDropped1, verifyLowestPrecedenceStateShouldBeDropped2, verifyLowestPrecedenceStateShouldBeDropped3, verifyLowestPrecedenceStateShouldBeDropped4, verifyLowestPrecedenceStateShouldBeDropped5.

Analyze Your Own Codebase

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

Try Supermodel Free