Liking cljdoc? Tell your friends :D

konserve-rocksdb.core

Address globally aggregated immutable key-value stores(s).

Address globally aggregated immutable key-value stores(s).
raw docstring

connect-rocksdb-storeclj

(connect-rocksdb-store path & {:keys [opts config] :as params})

Connect a konserve store backed by RocksDB.

Everything except :opts and :config is forwarded to connect-default-store, so :default-serializer, the handler maps and :buffer-size all work. They did not before: this built a LITERAL config map and destructured only :opts, so a caller asking for a different serializer got Fressian and was told nothing.

It also passed :compressor null-compressor and :encryptor null-encryptor, which connect-default-store never reads -- it takes both from (get-in config [:compressor :type]). Dead keys that made a top-level spelling look supported; removed.

Connect a konserve store backed by RocksDB.

Everything except `:opts` and `:config` is forwarded to
`connect-default-store`, so `:default-serializer`, the handler maps and
`:buffer-size` all work. They did not before: this built a LITERAL config
map and destructured only `:opts`, so a caller asking for a different
serializer got Fressian and was told nothing.

It also passed `:compressor null-compressor` and `:encryptor
null-encryptor`, which `connect-default-store` never reads -- it takes both
from `(get-in config [:compressor :type])`. Dead keys that made a top-level
spelling look supported; removed.
sourceraw docstring

delete-rocksdb-storeclj

(delete-rocksdb-store path & {:keys [opts]})
source

port!clj

(port! store)

Rewrite every remaining legacy (nippy) entry of store, a connected konserve-rocksdb store, in the current format. Optional: reads and writes work without it. Each store key is one transaction, fenced against concurrent writes, so it can run while the store is in use; keys stream in batches of 1000, so memory stays bounded.

Returns {:ported n, :superseded n, :orphans-deleted n, :failed [...]}:

  • ported: store keys whose complete legacy pair was rewritten;
  • superseded: keys that already had a current pair, so their legacy entries were only deleted;
  • orphans-deleted: keys with legacy entries but no complete pair anywhere (a .meta a 0.2.24 dissoc left, a stray backup value), deleted since nothing can read them;
  • failed: [{:raw-key :store-key :error}] for entries that cannot be decoded, left as they are. Afterwards the legacy key range is compacted, so the tombstones do not slow later opens and listings, and once nothing legacy is left the store stops probing for it.

Concurrency: it does not take konserve's per-key locks, and needs none. Writes, deletes and fenced writes of a key it is moving either win its fenced transaction or see the key already moved (see -sync); reads that interleave with it find the moved pair, which holds the same bytes. A key LISTING taken while it runs can miss a key or name one twice, since keys move from the legacy range to the current one in between pages. konserve's GC is unaffected: a key it does not see is not swept, and deleting a key twice is harmless.

Rewrite every remaining legacy (nippy) entry of `store`, a connected
konserve-rocksdb store, in the current format. Optional: reads and writes
work without it. Each store key is one transaction, fenced against
concurrent writes, so it can run while the store is in use; keys stream in
batches of 1000, so memory stays bounded.

Returns {:ported n, :superseded n, :orphans-deleted n, :failed [...]}:
- ported: store keys whose complete legacy pair was rewritten;
- superseded: keys that already had a current pair, so their legacy
  entries were only deleted;
- orphans-deleted: keys with legacy entries but no complete pair anywhere
  (a `.meta` a 0.2.24 `dissoc` left, a stray backup value), deleted since
  nothing can read them;
- failed: [{:raw-key :store-key :error}] for entries that cannot be decoded,
  left as they are.
Afterwards the legacy key range is compacted, so the tombstones do not slow
later opens and listings, and once nothing legacy is left the store stops
probing for it.

Concurrency: it does not take konserve's per-key locks, and needs none.
Writes, deletes and fenced writes of a key it is moving either win its
fenced transaction or see the key already moved (see `-sync`); reads that
interleave with it find the moved pair, which holds the same bytes. A key
LISTING taken while it runs can miss a key or name one twice, since keys
move from the legacy range to the current one in between pages. konserve's
GC is unaffected: a key it does not see is not swept, and deleting a key
twice is harmless.
sourceraw docstring

release-rocksdbclj

(release-rocksdb store)
source

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