Home / Function/ bubbleUp() — netty Function Reference

bubbleUp() — netty Function Reference

Architecture documentation for the bubbleUp() function in DefaultPriorityQueue.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9587b963_47e6_e495_a3f6_78de25f718b2["bubbleUp()"]
  346d98e4_880c_f43c_7c90_38ef8a6cab37["DefaultPriorityQueue"]
  9587b963_47e6_e495_a3f6_78de25f718b2 -->|defined in| 346d98e4_880c_f43c_7c90_38ef8a6cab37
  276f0f9e_51f5_c26e_cd5c_b7cbc2b6d3aa["offer()"]
  276f0f9e_51f5_c26e_cd5c_b7cbc2b6d3aa -->|calls| 9587b963_47e6_e495_a3f6_78de25f718b2
  6996c51b_528d_1b1c_08f8_4dfd8f453075["removeTyped()"]
  6996c51b_528d_1b1c_08f8_4dfd8f453075 -->|calls| 9587b963_47e6_e495_a3f6_78de25f718b2
  49acf204_e2c9_dd83_a84a_8b98719246ca["priorityChanged()"]
  49acf204_e2c9_dd83_a84a_8b98719246ca -->|calls| 9587b963_47e6_e495_a3f6_78de25f718b2
  style 9587b963_47e6_e495_a3f6_78de25f718b2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/internal/DefaultPriorityQueue.java lines 273–295

    private void bubbleUp(int k, T node) {
        while (k > 0) {
            int iParent = (k - 1) >>> 1;
            T parent = queue[iParent];

            // If the bubbleUp node is less than the parent, then we have found a spot to insert and still maintain
            // min-heap properties.
            if (comparator.compare(node, parent) >= 0) {
                break;
            }

            // Bubble the parent down.
            queue[k] = parent;
            parent.priorityQueueIndex(this, k);

            // Move k up the tree for the next iteration.
            k = iParent;
        }

        // We have found where node should live and still satisfy the min-heap property, so put it in the queue.
        queue[k] = node;
        node.priorityQueueIndex(this, k);
    }

Domain

Subdomains

Frequently Asked Questions

What does bubbleUp() do?
bubbleUp() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/internal/DefaultPriorityQueue.java.
Where is bubbleUp() defined?
bubbleUp() is defined in common/src/main/java/io/netty/util/internal/DefaultPriorityQueue.java at line 273.
What calls bubbleUp()?
bubbleUp() is called by 3 function(s): offer, priorityChanged, removeTyped.

Analyze Your Own Codebase

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

Try Supermodel Free