Home / Function/ closeStreamWithChildrenShouldRedistributeWeightToChildren() — netty Function Reference

closeStreamWithChildrenShouldRedistributeWeightToChildren() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d4966297_e9d8_8647_468b_91fb1d9ab86d["closeStreamWithChildrenShouldRedistributeWeightToChildren()"]
  f59fdba5_c411_919e_8d09_ef11c6679e0d["WeightedFairQueueByteDistributorDependencyTreeTest"]
  d4966297_e9d8_8647_468b_91fb1d9ab86d -->|defined in| f59fdba5_c411_919e_8d09_ef11c6679e0d
  style d4966297_e9d8_8647_468b_91fb1d9ab86d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorDependencyTreeTest.java lines 721–756

    @Test
    public void closeStreamWithChildrenShouldRedistributeWeightToChildren() throws Exception {
        Http2Stream streamA = connection.local().createStream(1, false);
        Http2Stream streamB = connection.local().createStream(3, false);
        Http2Stream streamC = connection.local().createStream(5, false);
        Http2Stream streamD = connection.local().createStream(7, false);
        Http2Stream streamE = connection.local().createStream(9, false);
        Http2Stream streamF = connection.local().createStream(11, false);
        Http2Stream streamG = connection.local().createStream(13, false);
        Http2Stream streamH = connection.local().createStream(15, false);

        setPriority(streamC.id(), streamA.id(), MAX_WEIGHT, false);
        setPriority(streamD.id(), streamA.id(), MAX_WEIGHT, false);
        setPriority(streamE.id(), streamA.id(), MAX_WEIGHT, false);

        setPriority(streamF.id(), streamB.id(), DEFAULT_PRIORITY_WEIGHT, false);
        setPriority(streamG.id(), streamB.id(), DEFAULT_PRIORITY_WEIGHT, false);
        setPriority(streamH.id(), streamB.id(), 2 * DEFAULT_PRIORITY_WEIGHT, false);

        streamE.close();
        // closing stream A will distribute its weight to the children (C & D) equally
        streamA.close();
        // closing stream B will distribute its weight to the children (F & G & H) proportionally
        streamB.close();
        // Level 0
        assertEquals(5, distributor.numChildren(connection.connectionStream().id()));
        // Level 1
        short halfWeight = DEFAULT_PRIORITY_WEIGHT / 2;
        assertTrue(distributor.isChild(streamC.id(), connection.connectionStream().id(), halfWeight));
        assertTrue(distributor.isChild(streamD.id(), connection.connectionStream().id(), halfWeight));

        short quarterWeight = DEFAULT_PRIORITY_WEIGHT / 4;
        assertTrue(distributor.isChild(streamF.id(), connection.connectionStream().id(), quarterWeight));
        assertTrue(distributor.isChild(streamG.id(), connection.connectionStream().id(), quarterWeight));
        assertTrue(distributor.isChild(streamH.id(), connection.connectionStream().id(), (short) (2 * quarterWeight)));
    }

Domain

Subdomains

Frequently Asked Questions

What does closeStreamWithChildrenShouldRedistributeWeightToChildren() do?
closeStreamWithChildrenShouldRedistributeWeightToChildren() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorDependencyTreeTest.java.
Where is closeStreamWithChildrenShouldRedistributeWeightToChildren() defined?
closeStreamWithChildrenShouldRedistributeWeightToChildren() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributorDependencyTreeTest.java at line 721.

Analyze Your Own Codebase

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

Try Supermodel Free