This namespace provides the basic mechanisms for AVL trees
This namespace provides the basic mechanisms for AVL trees
(abs n)
Returns the absolute value of the number n
Returns the absolute value of the number n
(add-to-root tree node deeper?)
Runs back up a branch to update and balance the branch for the transaction. node argument is a fully written branch of the tree. Returns the root of the tree.
Runs back up a branch to update and balance the branch for the transaction. node argument is a fully written branch of the tree. Returns the root of the tree.
(find-end-node {:keys [root] :as tree} side)
Finds the first or the last node in the tree
Finds the first or the last node in the tree
(find-node* {:keys [root node-comparator] :as tree} key)
Finds a node in the tree using a key. returns one of: null: an empty tree node: the data was found vector: the data was not there, and is found between 2 nodes. The leaf node is in the vector. The other (unneeded) node is represented by nil.
Finds a node in the tree using a key. returns one of: null: an empty tree node: the data was found vector: the data was not there, and is found between 2 nodes. The leaf node is in the vector. The other (unneeded) node is represented by nil.
(get-node tree id)
(get-node {:keys [block-manager node-cache] :as tree} id parent)
Returns a node object for a given ID
Returns a node object for a given ID
Offset of the left child, in longs
Offset of the left child, in longs
(new-block-tree block-manager-factory store-name data-size node-comparator)
(new-block-tree block-manager-factory
store-name
data-size
node-comparator
root-id)
Creates an empty block tree
Creates an empty block tree
(new-node tree)
(new-node tree data writer)
(new-node {:keys [block-manager node-cache]} data parent writer)
Returns a new node object
Returns a new node object
(rebalance! tree node balance)
Rebalance an AVL node. The root of the rebalance is returned unwritten, but all subnodes are written.
Rebalance an AVL node. The root of the rebalance is returned unwritten, but all subnodes are written.
Offset of the right child, in longs
Offset of the right child, in longs
(add this data writer)
(add this data writer location)
Adds data to the tree
Adds data to the tree
(at this new-root)
Returns a tree for a given transaction root
Returns a tree for a given transaction root
(find-node this key)
Finds a node in the tree using a key.
Finds a node in the tree using a key.
(first-node this)
Finds the first node in iteration order
Finds the first node in iteration order
(last-node this)
Finds the last node in iteration order
Finds the last node in iteration order
(modify-node! this node)
Makes a node available to modify in the current transaction. Returns the new tree and a node that can be modified (possible the same node)
Makes a node available to modify in the current transaction. Returns the new tree and a node that can be modified (possible the same node)
(copy-on-write this tree)
Return a node that is writable in the current transaction
Return a node that is writable in the current transaction
(get-balance this)
Retrieves the balance of the node
Retrieves the balance of the node
(get-child this tree side)
Gets the Node of the child on the given side
Gets the Node of the child on the given side
(get-child-id this side)
Gets the Node ID of the child on the given side
Gets the Node ID of the child on the given side
(get-parent this)
Returns the parent node. Not the Node ID, but the node object.
Returns the parent node. Not the Node ID, but the node object.
(set-balance! this balance)
Sets the balance of the node
Sets the balance of the node
(set-child! this side child)
Sets the ID of the child for the given side
Sets the ID of the child for the given side
(write this tree)
Persists the node to storage
Persists the node to storage
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close