L1.5 · the GLOBAL, file-based, content-addressed blob store (02 §3, §9) — the
Phase-2 payload substrate that SqliteStore's intern-payload!/read-payload*
delegate to. A blob's id is sha256:<hex> over payload/canonical-bytes,
computed BYTE-FOR-BYTE the same way MemoryStore addresses its in-memory blobs —
so the same value dedups to the same content node across sessions AND across
processes (the shared Merkle leaf, 02 §9). No sid: blobs are global.
On disk: the canonical EDN bytes are written at <root>/<aa>/<sha256hex>.blob
(sharded by the first two hex chars), read back via clojure.edn. Writes are
atomic (temp file + ATOMIC_MOVE) so a concurrent reader never observes a partial
blob and an idempotent re-write of identical content is a harmless no-op. No
extra dependency — just the JDK filesystem + the pure payload ns.
L1.5 · the GLOBAL, file-based, content-addressed blob store (02 §3, §9) — the Phase-2 payload substrate that SqliteStore's intern-payload!/read-payload* delegate to. A blob's id is `sha256:<hex>` over `payload/canonical-bytes`, computed BYTE-FOR-BYTE the same way MemoryStore addresses its in-memory blobs — so the same value dedups to the same content node across sessions AND across processes (the shared Merkle leaf, 02 §9). No `sid`: blobs are global. On disk: the canonical EDN bytes are written at `<root>/<aa>/<sha256hex>.blob` (sharded by the first two hex chars), read back via `clojure.edn`. Writes are atomic (temp file + ATOMIC_MOVE) so a concurrent reader never observes a partial blob and an idempotent re-write of identical content is a harmless no-op. No extra dependency — just the JDK filesystem + the pure `payload` ns.
(count-blobs {:keys [root]})Number of on-disk blob nodes (test/diagnostic — reachability GC is a later concern, 02 §7).
Number of on-disk blob nodes (test/diagnostic — reachability GC is a later concern, 02 §7).
(get* {:keys [root]} ref)Dereference a tagged ref to its value via global content lookup; nil if the
blob is absent (so store/verify-no-dangling-refs can detect a dangling ref).
Dereference a tagged ref to its value via global content lookup; nil if the blob is absent (so `store/verify-no-dangling-refs` can detect a dangling ref).
(has? {:keys [root]} ref)True iff the blob for ref is present on disk.
True iff the blob for `ref` is present on disk.
(open dir)Open (creating if absent) a blob store rooted at dir. Returns an opaque
handle {:root <File>}.
Open (creating if absent) a blob store rooted at `dir`. Returns an opaque
handle `{:root <File>}`.(put! {:keys [root]} value opts)Content-address value into the GLOBAL store and return a tagged payload-ref
(02 §3). id = sha256: over payload/canonical-bytes (the SAME basis as
MemoryStore, so refs are uniform across impls). IDEMPOTENT: identical values
resolve to one on-disk node (dedup / Merkle identity); a re-write of existing
content is skipped. The blob file is committed BEFORE the caller appends the
event that references it (orphan blobs are fine; dangling refs are forbidden).
Content-address `value` into the GLOBAL store and return a tagged payload-ref (02 §3). id = `sha256:` over `payload/canonical-bytes` (the SAME basis as MemoryStore, so refs are uniform across impls). IDEMPOTENT: identical values resolve to one on-disk node (dedup / Merkle identity); a re-write of existing content is skipped. The blob file is committed BEFORE the caller appends the event that references it (orphan blobs are fine; dangling refs are forbidden).
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 |