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.
(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.
(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.
(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).
(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.
(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.
(smap-rank rsm key)Number of keys strictly less than key. O(log n).
Number of keys strictly less than `key`. O(log n).
(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.
(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).
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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.
(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).
(sset-rank rss member)Number of members strictly less than member. O(log n).
Number of members strictly less than `member`. O(log n).
(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).
(sset-seq rss)Lazy ascending seq of members, or nil if empty.
Lazy ascending seq of members, or nil if empty.
(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.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |