(add-child node child)
(add-child node child buffer-aware?)
Adds a child to an internal node. Meant to be used when creating a node or when 'swapping' children. You should always add children in reverse sorted order. The flag 'buffer-aware?' indicates whether to take the message buffers into account when assigning local cap keys for the child.
Adds a child to an internal node. Meant to be used when creating a node or when 'swapping' children. You should always add children in reverse sorted order. The flag 'buffer-aware?' indicates whether to take the message buffers into account when assigning local cap keys for the child.
(add-children node adopted->msgs)
Takes a node and a map nodes->msgs to add. Ensures min- and max-rec are up-to-date.
Takes a node and a map nodes->msgs to add. Ensures min- and max-rec are up-to-date.
(add-messages node msgs)
Adds many messages to a node's message buffer. Updates min- and max-rec accordingly.
Adds many messages to a node's message buffer. Updates min- and max-rec accordingly.
(add-ranged-message node msg)
Adds a ranged message to all appropriate message buffers in the node. No updates are made to min- or max-rec.
Adds a ranged message to all appropriate message buffers in the node. No updates are made to min- or max-rec.
(add-simple-message node msg)
Add a single message to a node's message buffer. Updates min- and max-rec accordingly.
Add a single message to a node's message buffer. Updates min- and max-rec accordingly.
(apply-messages node msgs)
Applies message operations. Valid ops and their implementations are defined in the message namespace.
Applies message operations. Valid ops and their implementations are defined in the message namespace.
(empty-properties props)
Selects from properties the keys #{:comparator :order :leaf? :buffer-size} then merges {:root? false} and returns the result.
Selects from properties the keys #{:comparator :order :leaf? :buffer-size} then merges {:root? false} and returns the result.
(ensure-pointer pointer-thing)
Takes either a pointer or a node id. Returns either that pointer or a minimal implementation of Pointer and Node that will give its uuid.
Takes either a pointer or a node id. Returns either that pointer or a minimal implementation of Pointer and Node that will give its uuid.
(ensure-uuid maybe-uuid id tx)
Expects, but does not enforce, that maybe-uuid is either nil or a string of (format "%s-%s-%s" id tx (UUID/randomUUID)). If maybe-uuid is nil, this returns a new string of that format.
Expects, but does not enforce, that maybe-uuid is either nil or a string of (format "%s-%s-%s" id tx (UUID/randomUUID)). If maybe-uuid is nil, this returns a new string of that format.
(min-node-size node)
Minimum size the node can be before considered 'too small'.
Minimum size the node can be before considered 'too small'.
(min-rec-buffer-aware node k child)
Finds the min-rec of the child, taking into account messages currently sitting in the buffer to be delivered to that child.
Finds the min-rec of the child, taking into account messages currently sitting in the buffer to be delivered to that child.
(new-node-id)
Nodes within a tree are identified uniquely by a combination of id and version. Whenever a brand-new node is added to the tree, a new node id is generated sequentially. That's what this method does.
Nodes within a tree are identified uniquely by a combination of id and version. Whenever a brand-new node is added to the tree, a new node id is generated sequentially. That's what this method does.
(node-minrec-above this k)
(node-minrec-above this k buffer-aware?)
Takes an internal node and a dictionary key. Returns the min-rec of the next node 'above' that key. Useful for establishing cap keys or sorting messages.
Takes an internal node and a dictionary key. Returns the min-rec of the next node 'above' that key. Useful for establishing cap keys or sorting messages.
(node-overlaps? node range)
(node-overlaps? cmp node [y1 y2])
Does this node overlap with this range? Optionally accepts comparator.
Does this node overlap with this range? Optionally accepts comparator.
(remove-children node ks)
Takes an inner node and a simple sequence of keys. Removes children bound to those keys, along with any messages intended for those children. Updates min- and max-rec accordingly.
Takes an inner node and a simple sequence of keys. Removes children bound to those keys, along with any messages intended for those children. Updates min- and max-rec accordingly.
(remove-values node ks)
Takes a leaf node and a simple sequence of keys. Removes the values stored by those keys. Once it is finished, it updates the min-rec and max-rec properties of the node.
Takes a leaf node and a simple sequence of keys. Removes the values stored by those keys. Once it is finished, it updates the min-rec and max-rec properties of the node.
(reset-messages node)
Removes all of the messages from the node's buffer and re-adds them. To be used when the node's internal cap keys have been altered to keep the message buffers in sync.
Removes all of the messages from the node's buffer and re-adds them. To be used when the node's internal cap keys have been altered to keep the message buffers in sync.
(transfer-messages node ks->msgs)
Adds messages to the buffer of a node when you already know which keys the messages should correspond to. Does nothing to the node's min-rec or max-rec values.
Adds messages to the buffer of a node when you already know which keys the messages should correspond to. Does nothing to the node's min-rec or max-rec values.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close