Class BTree.FastBuilder<V>

java.lang.Object
org.apache.cassandra.utils.btree.BTree.FastBuilder<V>
All Implemented Interfaces:
AutoCloseable
Enclosing class:
BTree

public static class BTree.FastBuilder<V> extends Object implements AutoCloseable
A pooled builder for constructing a tree in-order, and without needing any reconciliation.

Constructs whole nodes in place, so that a flush of a complete node can take its buffer entirely. Since we build trees of a predictable shape (i.e. perfectly dense) we do not construct a size map.

  • Method Details

    • add

      public void add(V value)
    • add

      public void add(Object[] from, int offset, int count)
    • build

      public Object[] build()
    • buildReverse

      public Object[] buildReverse()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • validateEmpty

      public boolean validateEmpty()
    • addKey

      public void addKey(Object nextKey)
      Add nextKey to the buffer, overflowing if necessary
    • addKeyNoOverflow

      public void addKeyNoOverflow(Object nextKey)
      Add nextKey to the buffer; the caller specifying overflow is unnecessary
    • maybeAddKeyNoOverflow

      public void maybeAddKeyNoOverflow(Object nextKey)
      Add nextKey to the buffer; the caller specifying overflow is unnecessary
    • maybeAddKey

      public void maybeAddKey(Object nextKey)
      Add nextKey to the buffer; the caller specifying overflow is unnecessary
    • completeBuild

      public Object[] completeBuild()
      Complete the build. Drains the node and any used or newly-required parent and returns the root of the resulting tree.
      Returns:
      the root of the constructed tree.