Liking cljdoc? Tell your friends :D

xitdb.util.sorted-operations

Bridges the XITDBSorted* wrapper types to the Java Read/WriteSortedMap. Keys are encoded/decoded through xitdb.util.sorted-key (order-preserving, reversible) rather than hashed, so the real key is recoverable on read.

Bridges the XITDBSorted* wrapper types to the Java Read/WriteSortedMap.
Keys are encoded/decoded through `xitdb.util.sorted-key` (order-preserving,
reversible) rather than hashed, so the real key is recoverable on read.
raw docstring

smap-assoc-value!clj

(smap-assoc-value! wsm k v)

Encodes k, writes value v at its cursor. Returns the WriteSortedMap.

Encodes `k`, writes value `v` at its cursor. Returns the WriteSortedMap.
sourceraw docstring

smap-contains-key?clj

(smap-contains-key? rsm key)
source

smap-dissoc-key!clj

(smap-dissoc-key! wsm k)

Removing nil (never present) is a no-op, like Clojure's sorted-map.

Removing nil (never present) is a no-op, like Clojure's sorted-map.
sourceraw docstring

smap-empty!clj

(smap-empty! wsm)

Replaces contents with an empty sorted map, in place. Returns the WriteSortedMap. Mirrors operations/map-empty!: writes a fresh empty SORTED_MAP slot at the cursor so the value stays a sorted map (the key-comparator makes v->slot! accept it as a default-ordered tree).

Replaces contents with an empty sorted map, in place. Returns the
WriteSortedMap. Mirrors `operations/map-empty!`: writes a fresh empty
SORTED_MAP slot at the cursor so the value stays a sorted map (the
`key-comparator` makes `v->slot!` accept it as a default-ordered tree).
sourceraw docstring

smap-item-countclj

(smap-item-count rsm)

O(1) entry count, delegating to the rank-augmented B-tree.

O(1) entry count, delegating to the rank-augmented B-tree.
sourceraw docstring

smap-kv-reduceclj

(smap-kv-reduce rsm read-from-cursor f init)
source

smap-nthclj

(smap-nth rsm read-from-cursor index not-found)

MapEntry at rank index (negative counts from the end), or not-found when out of range. O(log n) via the rank-augmented B-tree.

MapEntry at rank `index` (negative counts from the end), or `not-found` when
out of range. O(log n) via the rank-augmented B-tree.
sourceraw docstring

smap-rankclj

(smap-rank rsm key)

Number of keys strictly less than key. O(log n).

Number of keys strictly less than `key`. O(log n).
sourceraw docstring

smap-read-cursorclj

(smap-read-cursor rsm key)

Read cursor for key, or nil if absent. nil (not storable as a sorted key) is never present, so lookups with it return nil instead of throwing.

Read cursor for `key`, or nil if absent. nil (not storable as a sorted key)
is never present, so lookups with it return nil instead of throwing.
sourceraw docstring

smap-rseqclj

(smap-rseq rsm read-from-cursor)
(smap-rseq rsm read-from-cursor start)

Lazy descending seq of MapEntry pairs, walking getIndexKeyValuePair from index start down to 0. Stays low-memory (one entry materialised at a time).

Lazy descending seq of MapEntry pairs, walking `getIndexKeyValuePair` from
index `start` down to 0. Stays low-memory (one entry materialised at a time).
sourceraw docstring

smap-seqclj

(smap-seq rsm read-from-cursor)

Lazy ascending seq of key-value MapEntry pairs, or nil if empty. read-from-cursor converts a value cursor to a Clojure value.

Lazy ascending seq of key-value MapEntry pairs, or nil if empty.
`read-from-cursor` converts a value cursor to a Clojure value.
sourceraw docstring

smap-seq-fromclj

(smap-seq-from rsm read-from-cursor key)

Lazy ascending seq of MapEntry pairs starting at the first key >= key, using the engine's native O(log n) lower-bound seek. nil if none.

Lazy ascending seq of MapEntry pairs starting at the first key >= `key`,
using the engine's native O(log n) lower-bound seek. nil if none.
sourceraw docstring

smap-seq-from-indexclj

(smap-seq-from-index rsm read-from-cursor index)

Lazy ascending seq of MapEntry pairs starting at rank index (0-based), using the engine's native O(log n) iteratorFromIndex seek. nil if none. Streams one entry at a time; does not materialise the whole collection.

Lazy ascending seq of MapEntry pairs starting at rank `index` (0-based),
using the engine's native O(log n) `iteratorFromIndex` seek. nil if none.
Streams one entry at a time; does not materialise the whole collection.
sourceraw docstring

smap-write-cursorclj

(smap-write-cursor wsm key)

Write cursor for key. Creates the key if it doesn't exist, so callers that only want to read an existing entry must check smap-read-cursor first.

Write cursor for `key`. Creates the key if it doesn't exist, so callers that
only want to read an existing entry must check `smap-read-cursor` first.
sourceraw docstring

sset-assoc-value!clj

(sset-assoc-value! wss member)

Adds member to the set (no-op if already present). Returns the WriteSortedSet.

Adds `member` to the set (no-op if already present). Returns the WriteSortedSet.
sourceraw docstring

sset-contains?clj

(sset-contains? rss member)

nil (not storable as a sorted member) is never present, so checking for it returns false instead of throwing.

nil (not storable as a sorted member) is never present, so checking for it
returns false instead of throwing.
sourceraw docstring

sset-disj-value!clj

(sset-disj-value! wss member)

Removes member from the set (no-op if absent, including nil, which is never present). Returns the WriteSortedSet.

Removes `member` from the set (no-op if absent, including nil, which is
never present). Returns the WriteSortedSet.
sourceraw docstring

sset-empty!clj

(sset-empty! wss)

Replaces contents with an empty sorted set, in place. Returns the WriteSortedSet. Mirrors operations/set-empty!: writes a fresh empty SORTED_SET slot at the cursor so the value stays a sorted set.

Replaces contents with an empty sorted set, in place. Returns the
WriteSortedSet. Mirrors `operations/set-empty!`: writes a fresh empty
SORTED_SET slot at the cursor so the value stays a sorted set.
sourceraw docstring

sset-item-countclj

(sset-item-count rss)

O(1) member count.

O(1) member count.
sourceraw docstring

sset-nthclj

(sset-nth rss index not-found)

Member at rank index (negative counts from the end), or not-found when out of range. O(log n).

Member at rank `index` (negative counts from the end), or `not-found` when
out of range. O(log n).
sourceraw docstring

sset-rankclj

(sset-rank rss member)

Number of members strictly less than member. O(log n).

Number of members strictly less than `member`. O(log n).
sourceraw docstring

sset-rseqclj

(sset-rseq rss)
(sset-rseq rss start)

Lazy descending seq of members, walking getIndexKeyValuePair from index start down to 0. Low-memory (one member at a time).

Lazy descending seq of members, walking `getIndexKeyValuePair` from index
`start` down to 0. Low-memory (one member at a time).
sourceraw docstring

sset-seqclj

(sset-seq rss)

Lazy ascending seq of members, or nil if empty.

Lazy ascending seq of members, or nil if empty.
sourceraw docstring

sset-seq-fromclj

(sset-seq-from rss member)

Lazy ascending seq of members starting at the first member >= member, using the engine's native O(log n) lower-bound seek. nil if none.

Lazy ascending seq of members starting at the first member >= `member`,
using the engine's native O(log n) lower-bound seek. nil if none.
sourceraw docstring

sset-seq-from-indexclj

(sset-seq-from-index rss index)

Lazy ascending seq of members starting at rank index (0-based), using the engine's native O(log n) iteratorFromIndex seek. nil if none. Streams one member at a time; does not materialise the whole collection.

Lazy ascending seq of members starting at rank `index` (0-based), using the
engine's native O(log n) `iteratorFromIndex` seek. nil if none. Streams one
member at a time; does not materialise the whole collection.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close