Liking cljdoc? Tell your friends :D

hitchhiker.tree.core


<?clj/smacro

(<? ch)

Same as core.async <! but throws an exception if the channel returns a throwable error.

Same as core.async <! but throws an exception if the channel returns a
throwable error.
sourceraw docstring

<??clj

(<?? ch)

Same as core.async <!! but throws an exception if the channel returns a throwable error.

Same as core.async <!! but throws an exception if the channel returns a
throwable error.
sourceraw docstring

<?resolveclj/smacro

(<?resolve e)

HACK Attempt faster inlined resolve to avoid unnecessary channel ops.

HACK Attempt faster inlined resolve to avoid unnecessary channel ops.
sourceraw docstring

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

Configcljs

source

data-nodeclj/s

(data-node cfg children)

Creates a new data node

Creates a new data node
sourceraw docstring

data-node?clj/s

(data-node? node)
source

DataNodecljs

source

deleteclj/s

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

dirty!clj/s

(dirty! node)

Marks a node as being dirty if it was clean

Marks a node as being dirty if it was clean
sourceraw docstring

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≠

clj
(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.
cljs
(forward-iterator iter-ch path start-key)

Takes the result of a search and puts the iterated elements onto iter-ch going forward over the tree as needed. Does lg(n) backtracking sometimes.

Takes the result of a search and puts the iterated elements onto iter-ch
going forward over the tree as needed. Does lg(n) backtracking sometimes.
source (clj)source (cljs)raw docstring

go-tryclj/smacro

(go-try & body)

Asynchronously executes the body in a go block. Returns a channel which will receive the result of the body when completed or the exception if an exception is thrown. You are responsible to take this exception and deal with it! This means you need to take the result from the channel at some point.

Asynchronously executes the body in a go block. Returns a channel
which will receive the result of the body when completed or the
exception if an exception is thrown. You are responsible to take
this exception and deal with it! This means you need to take the
result from the channel at some point.
sourceraw docstring

IBackendclj/s≠protocol

write-nodeclj/s

(write-node backend node session)

Writes the given node to storage, returning a go-block with its assigned address

Writes the given node to storage, returning a go-block with its assigned address

delete-addrclj/s

(delete-addr backend addr session)

Deletes the given addr from storage

Deletes the given addr from storage

new-sessionclj/s

(new-session backend)

Returns a session object that will collect stats

Returns a session object that will collect stats

anchor-rootclj/s

(anchor-root backend node)

Tells the backend this is a temporary root

Tells the backend this is a temporary root
source

if-cljsclj/smacro

(if-cljs then else)

Return then if we are generating cljs code and else for Clojure code. https://groups.google.com/d/msg/clojurescript/iBY5HaQda4A/w1lAQi9_AwsJ

Return then if we are generating cljs code and else for Clojure code.
https://groups.google.com/d/msg/clojurescript/iBY5HaQda4A/w1lAQi9_AwsJ
sourceraw docstring

IKeyCompareclj/s≠protocol

compareclj/s

(compare key1 key2)
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

IndexNodecljs

source

INodeclj/s≠protocol

lookupclj/s

(lookup node key)

Returns the child node which contains the given key

Returns the child node which contains the given key

merge-nodeclj/s

(merge-node node other)

Combines this node with the other to form a bigger node. We assume they're siblings

Combines this node with the other to form a bigger node. We assume they're siblings

overflow?clj/s

(overflow? node)

Returns true if this node has too many elements

Returns true if this node has too many elements

split-nodeclj/s

(split-node node)

Returns a Split object with the 2 nodes that we turned this into

Returns a Split object with the 2 nodes that we turned this into

underflow?clj/s

(underflow? node)

Returns true if this node has too few elements

Returns true if this node has too few elements
source

insertclj/s

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

IResolveclj/s≠protocol

All nodes must implement this protocol. It's includes the minimal functionality necessary to avoid resolving nodes unless strictly necessary.

All nodes must implement this protocol. It's includes the minimal functionality
necessary to avoid resolving nodes unless strictly necessary.

index?clj/s

(index? _)

Returns true if this is an index node

Returns true if this is an index node

dirty?clj/s

(dirty? _)

Returns true if this should be flushed

Returns true if this should be flushed

last-keyclj/s

(last-key _)

Returns the rightmost key of the node

Returns the rightmost key of the node

resolveclj/s

(resolve _)

Returns the INode version of this node in a go-block; could trigger IO

Returns the INode version of this node in a go-block; could trigger IO
sourceraw docstring

lookup-fwd-iterclj

(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

node-status-bitsclj

(node-status-bits node)
source

nth-of-setclj/s

(nth-of-set set index)

Like nth, but for sorted sets. O(n)

Like nth, but for sorted sets. O(n)
sourceraw docstring

order-on-edn-typesclj/s

(order-on-edn-types t)
source

(print-data-node node writer fully-qualified?)
source

(print-index-node node writer fully-qualified?)

Optionally include

Optionally include
sourceraw docstring

(print-testing-addr node writer fully-qualified?)
source

reduce<clj/s

(reduce< go-f init s)

Reduces over a sequence s with a go function go-f given the initial value init.

Reduces over a sequence s with a go function go-f given the initial value
init.
sourceraw docstring

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

Splitcljs

source

TestingAddrcljs

source

TestingBackendcljs

source

throw-if-exceptionclj/s

(throw-if-exception x)

Helper method that checks if x is Exception and if yes, wraps it in a new exception, passing though ex-data if any, and throws it. The wrapping is done to maintain a full stack trace when jumping between multiple contexts.

Helper method that checks if x is Exception and if yes, wraps it in a new
exception, passing though ex-data if any, and throws it. The wrapping is done
to maintain a full stack trace when jumping between multiple contexts.
sourceraw docstring

tree-node?clj/s

(tree-node? node)
source

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

× close