Default tree implementation
The parts of the serialization system that seem like they're need hooks are:
Must provide a function that takes a node, serializes it, and returns an addr
Must be able to rollback writing an addr
Whatever the addr it returns, it should cache its resolve in-mem somehow
The serialize a node & rollback a node functions should accept a 'stats' object as well
The 'stats' object must be convertible to a summary or whatever at the end
Default tree implementation The parts of the serialization system that seem like they're need hooks are: * Must provide a function that takes a node, serializes it, and returns an addr * Must be able to rollback writing an addr * Whatever the addr it returns, it should cache its resolve in-mem somehow * The serialize a node & rollback a node functions should accept a 'stats' object as well * The 'stats' object must be convertible to a summary or whatever at the end
(backtrack-up-path-until path pred)
Given a path (starting with root and ending with an index), searches backwards, passing each pair of parent & index we just came from to the predicate function. When that function returns true, we return the path ending in the index for which it was true, or else we return the empty path
Given a path (starting with root and ending with an index), searches backwards, passing each pair of parent & index we just came from to the predicate function. When that function returns true, we return the path ending in the index for which it was true, or else we return the empty path
(data-node children cfg)
Creates a new data node
Creates a new data node
(flush-tree tree backend)
(flush-tree tree backend stats)
Given the tree, finds all dirty nodes, delivering addrs into them. Every dirty node also gets replaced with its TestingAddr. These form a GC cycle, have fun with the unmanaged memory port :)
Given the tree, finds all dirty nodes, delivering addrs into them. Every dirty node also gets replaced with its TestingAddr. These form a GC cycle, have fun with the unmanaged memory port :)
(flush-tree-without-root tree backend)
(flush-tree-without-root tree backend stats root-node?)
Given the tree, finds all dirty nodes, delivering addrs into them. Does not flush root node, but returns it.
Given the tree, finds all dirty nodes, delivering addrs into them. Does not flush root node, but returns it.
(forward-iterator path start-key)
Takes the result of a search and returns an iterator going forward over the tree. Does lg(n) backtracking sometimes.
Takes the result of a search and returns an iterator going forward over the tree. Does lg(n) backtracking sometimes.
(index-node-keys children)
Calculates the separating keys given the children of an index node
Calculates the separating keys given the children of an index node
(lookup-key tree key)
(lookup-key tree key not-found)
Given a B-tree and a key, gets an iterator into the tree
Given a B-tree and a key, gets an iterator into the tree
(lookup-path tree key)
Given a B-tree and a key, gets a path into the tree
Given a B-tree and a key, gets a path into the tree
(nth-of-set set index)
Like nth, but for sorted sets. O(n) in worst case, 0(1) when idx out of bounds.
Like nth, but for sorted sets. O(n) in worst case, 0(1) when idx out of bounds.
(right-successor path)
Given a node on a path, find's that node's right successor node
Given a node on a path, find's that node's right successor node
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close