Liking cljdoc? Tell your friends :D

konserve-rocksdb.legacy

Reads the entries konserve-rocksdb 0.2.26 and earlier wrote with nippy, without nippy.

Up to 0.2.26 every RocksDB key and value was taoensso.nippy/freeze output, and what was frozen is narrow: a key is a string; a value entry a byte array (nil where a backup copied an absent key, and a string where an old bassoc was handed one); a .meta entry the map {:header bytes :meta bytes}. This decodes exactly those, in every size form nippy used, inside nippy's uncompressed, LZ4 and zstd envelopes. Any other type id is refused by number, never interpreted: no class is looked up or instantiated, no reader, record, deftype or Serializable path exists here. Every declared length is checked against the input before anything is allocated.

It also computes the legacy RocksDB keys of a store key, the bytes to look up on read and delete on write.

Reads the entries konserve-rocksdb 0.2.26 and earlier wrote with nippy,
without nippy.

Up to 0.2.26 every RocksDB key and value was `taoensso.nippy/freeze` output,
and what was frozen is narrow: a key is a string; a value entry a byte array
(nil where a backup copied an absent key, and a string where an old `bassoc`
was handed one); a `.meta` entry the map `{:header bytes :meta bytes}`. This
decodes exactly those, in every size form nippy used, inside nippy's
uncompressed, LZ4 and zstd envelopes. Any other type id is refused by
number, never interpreted: no class is looked up or instantiated, no
reader, record, deftype or Serializable path exists here. Every declared
length is checked against the input before anything is allocated.

It also computes the legacy RocksDB keys of a store key, the bytes to look
up on read and delete on write.
raw docstring

decode-keyclj

(decode-key raw-key)

The store key a legacy RocksDB key froze.

The store key a legacy RocksDB key froze.
sourceraw docstring

decode-metaclj

(decode-meta ba store-key raw-key)

{:header bytes :meta bytes} of the .meta entry ba, or nil.

`{:header bytes :meta bytes}` of the `.meta` entry `ba`, or nil.
sourceraw docstring

decode-valueclj

(decode-value ba store-key raw-key)

The bytes of the value entry ba of store-key at raw-key, or nil (a backup copy of an absent key).

A string comes back as its UTF-8 bytes. konserve-rocksdb up to 0.2.22 stored whatever bassoc was handed, so a string given to bassoc was frozen as a string, and reading it as a binary failed. konserve now turns a string given to bassoc into its bytes before any backend sees it (the platform default charset, UTF-8 on every supported JVM), so these are the bytes the same call stores today: what bassoc meant.

The bytes of the value entry `ba` of `store-key` at `raw-key`, or nil (a
backup copy of an absent key).

A string comes back as its UTF-8 bytes. konserve-rocksdb up to 0.2.22 stored
whatever `bassoc` was handed, so a string given to `bassoc` was frozen as a
string, and reading it as a binary failed. konserve now turns a string given
to `bassoc` into its bytes before any backend sees it (the platform default
charset, UTF-8 on every supported JVM), so these are the bytes the same call
stores today: what `bassoc` meant.
sourceraw docstring

encodingsclj

The two ways a legacy key can encode a store key, in order of preference: :released (string id 105), as nippy 3.1, 3.2 and 3.4 to 3.8 froze strings, which is what released jars declared; and :nippy-3-3 (id 96), as nippy 3.3.x and 3.9+ do: unreleased builds from late 2023 to late 2025, and any application whose dependencies resolved such a nippy over the declared one. They differ for strings of 1 to 255 UTF-8 bytes.

The two ways a legacy key can encode a store key, in order of preference:
`:released` (string id 105), as nippy 3.1, 3.2 and 3.4 to 3.8 froze
strings, which is what released jars declared; and `:nippy-3-3` (id 96),
as nippy 3.3.x and 3.9+ do: unreleased builds from late 2023 to late 2025,
and any application whose dependencies resolved such a nippy over the
declared one. They differ for strings of 1 to 255 UTF-8 bytes.
sourceraw docstring

frozen-nil?clj

(frozen-nil? ba)

Is ba a frozen nil, the value a backup of an absent key holds? Exact bytes, so existence checks need not decode a value.

Is `ba` a frozen nil, the value a backup of an absent key holds? Exact
bytes, so existence checks need not decode a value.
sourceraw docstring

hexclj

(hex ba)
source

key-bytesclj

(key-bytes encoding s)

The legacy RocksDB key for store key s in encoding, or nil when nippy would have compressed it (a frozen string over 8 KiB), which no store key is.

The legacy RocksDB key for store key `s` in `encoding`, or nil when nippy
would have compressed it (a frozen string over 8 KiB), which no store key
is.
sourceraw docstring

key-variantsclj

(key-variants s)

[encoding bytes] for each distinct legacy key of store key s, preferred first.

[encoding bytes] for each distinct legacy key of store key `s`, preferred
first.
sourceraw docstring

legacy-bytes?clj

(legacy-bytes? ba)

Does ba start with nippy's header signature, "NPY"? Every legacy key does, and no current key can (konserve-rocksdb.core/encode-key refuses one), so in RocksDB's bytewise order the legacy keys are exactly the keys with this prefix.

Does `ba` start with nippy's header signature, "NPY"? Every legacy key
does, and no current key can (`konserve-rocksdb.core/encode-key` refuses
one), so in RocksDB's bytewise order the legacy keys are exactly the keys
with this prefix.
sourceraw docstring

legacy-prefixclj

(legacy-prefix)

The bytes every legacy key starts with.

The bytes every legacy key starts with.
sourceraw docstring

unreadableclj

(unreadable what store-key raw-key detail)

Throw: the legacy entry at raw-key cannot be read.

Throw: the legacy entry at `raw-key` cannot be read.
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