Liking cljdoc? Tell your friends :D

hitchhiker.tree

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
raw docstring

<-cacheclj/s

(<-cache cache calc-fn)
source

<?-resolveclj/smacro

(<?-resolve n)
source

b-treeclj/s

(b-tree cfg & kvs)
source

backtrack-up-path-untilclj/s

(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
sourceraw docstring

cacheclj/s

(cache)
source

Configclj/s

source

data-nodeclj/s

(data-node children cfg)

Creates a new data node

Creates a new data node
sourceraw docstring

data-node?clj/s

(data-node? node)
source

DataNodeclj/s

source

deleteclj/s

(delete {:keys [cfg] :as tree} key)
source

empty-sorted-map-by-compareclj/s

source

flush-childrenclj/s

(flush-children children backend session)
source

flush-children-without-rootclj/s

(flush-children-without-root children backend session)
source

flush-treeclj/s

(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 :)
sourceraw docstring

flush-tree-without-rootclj/s

(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.
sourceraw docstring

forward-iteratorclj/s

(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.
sourceraw docstring

index-nodeclj/s

(index-node children op-buf cfg)
source

index-node-keysclj/s

(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
sourceraw docstring

index-node?clj/s

(index-node? node)
source

IndexNodeclj/s

source

insertclj/s

(insert {:keys [cfg] :as tree} k v)
source

lookup-fwd-iterclj/s

(lookup-fwd-iter tree key)
source

lookup-keyclj/s

(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
sourceraw docstring

lookup-pathclj/s

(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
sourceraw docstring

nth-of-setclj/s

(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.
sourceraw docstring

resolved?clj/s

(resolved? node)
source

right-successorclj/s

(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
sourceraw docstring

Splitclj/s

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close