Skip to main content

Crate somatize_store

Crate somatize_store 

Source
Expand description

Where what is worth keeping is kept: bytes by content, and names that point at them. The hole the core left, plugged with directories, hashes and atomic renames.

mapkeywhat it is for
blobsthe digest of the contentweights, artifacts, intermediate data
nameswhatever you call ita cache key, an artifact’s id

Two and not one because a cache key is not a content hash: it is the hash of the recipe, known before the value it names exists. Content addressing alone could not answer do I already have what this recipe produces?

A blob is written once and never changes; a binding is a small record written by atomic rename. That is what lets a network folder be shared by everyone at once with no lock server, and it turned out to work unchanged against a bucket.

whowhat it keepsunder what name
a worker’s Serving::storeartifacts, so a catalog is not sent twiceartifact:<kind>:<id>
Cachewhat a node producedvalue:<key>
Recorderwhat happened, one record per forwardrun/<id>/<n>

Cache is the Keeper and Recorder the Watcher — the same division from both ends. A queryable index is derived from these records and can be thrown away; making it the truth would mean a single writer, which is where NFS breaks.

Structs§

Bound
A name, what it points at, and what was said about it.
Cache
Names what a graph produces, and keeps it in a store.
Digest
The identity of some bytes, written as sha256: and hex.
Local
A store kept in a directory.
Recorder
Writes down what happened, one record per forward. It owns its store where a Cache borrows one: a cache is made for one forward and a recorder counts them.

Enums§

StoreError
Why something could not be kept, or found.

Traits§

Store
Keeps bytes by their content, and names that point at them.

Functions§

bytes_of
A value in bytes, refusing what only exists in this process.
name_of
Where a value is bound, which is not where an artifact is.
value_of
And back. Nothing may be left over: leftovers are as suspicious as missing bytes, and no format checks that for you.

Type Aliases§

Meta
What you want to remember about something you stored, in the order you say it. Text and not a closed type because the vocabulary is the caller’s; what this crate does with it is write it down and hand it back.