Package org.apache.cassandra.utils.btree
Class BTree.FastBuilder<V>
java.lang.Object
org.apache.cassandra.utils.btree.BTree.FastBuilder<V>
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- BTree
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 Summary
Modifier and TypeMethodDescriptionvoidvoidvoidAddnextKeyto the buffer, overflowing if necessaryvoidaddKeyNoOverflow(Object nextKey) AddnextKeyto the buffer; the caller specifying overflow is unnecessaryObject[]build()Object[]voidclose()Object[]Complete the build.voidmaybeAddKey(Object nextKey) AddnextKeyto the buffer; the caller specifying overflow is unnecessaryvoidmaybeAddKeyNoOverflow(Object nextKey) AddnextKeyto the buffer; the caller specifying overflow is unnecessaryboolean
-
Method Details
-
add
-
add
-
build
-
buildReverse
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
validateEmpty
public boolean validateEmpty() -
addKey
AddnextKeyto the buffer, overflowing if necessary -
addKeyNoOverflow
AddnextKeyto the buffer; the caller specifying overflow is unnecessary -
maybeAddKeyNoOverflow
AddnextKeyto the buffer; the caller specifying overflow is unnecessary -
maybeAddKey
AddnextKeyto the buffer; the caller specifying overflow is unnecessary -
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.
-