distribute() — netty Function Reference
Architecture documentation for the distribute() function in WeightedFairQueueByteDistributor.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD a477195a_8699_0505_29de_529047b61e11["distribute()"] f6394c11_feeb_5e3e_8717_b7d2d36bbf34["WeightedFairQueueByteDistributor"] a477195a_8699_0505_29de_529047b61e11 -->|defined in| f6394c11_feeb_5e3e_8717_b7d2d36bbf34 fee5801b_b90a_5512_05a6_7256df952cd8["distributeToChildren()"] fee5801b_b90a_5512_05a6_7256df952cd8 -->|calls| a477195a_8699_0505_29de_529047b61e11 fee5801b_b90a_5512_05a6_7256df952cd8["distributeToChildren()"] a477195a_8699_0505_29de_529047b61e11 -->|calls| fee5801b_b90a_5512_05a6_7256df952cd8 964dcf1d_0ed8_fa97_111f_2cd0fa2a5476["isActive()"] a477195a_8699_0505_29de_529047b61e11 -->|calls| 964dcf1d_0ed8_fa97_111f_2cd0fa2a5476 92f89bf4_2b10_7968_2875_1890f0eed386["write()"] a477195a_8699_0505_29de_529047b61e11 -->|calls| 92f89bf4_2b10_7968_2875_1890f0eed386 3042fea5_9611_a8ff_248e_a67b1cffbc63["updateStreamableBytes()"] a477195a_8699_0505_29de_529047b61e11 -->|calls| 3042fea5_9611_a8ff_248e_a67b1cffbc63 style a477195a_8699_0505_29de_529047b61e11 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http2/src/main/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributor.java lines 256–275
@Override
public boolean distribute(int maxBytes, Writer writer) throws Http2Exception {
// As long as there is some active frame we should write at least 1 time.
if (connectionState.activeCountForTree == 0) {
return false;
}
// The goal is to write until we write all the allocated bytes or are no longer making progress.
// We still attempt to write even after the number of allocated bytes has been exhausted to allow empty frames
// to be sent. Making progress means the active streams rooted at the connection stream has changed.
int oldIsActiveCountForTree;
do {
oldIsActiveCountForTree = connectionState.activeCountForTree;
// connectionState will never be active, so go right to its children.
maxBytes -= distributeToChildren(maxBytes, writer, connectionState);
} while (connectionState.activeCountForTree != 0 &&
(maxBytes > 0 || oldIsActiveCountForTree != connectionState.activeCountForTree));
return connectionState.activeCountForTree != 0;
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does distribute() do?
distribute() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributor.java.
Where is distribute() defined?
distribute() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributor.java at line 256.
What does distribute() call?
distribute() calls 4 function(s): distributeToChildren, isActive, updateStreamableBytes, write.
What calls distribute()?
distribute() is called by 1 function(s): distributeToChildren.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free