Skip to main content

Crate corium_store

Crate corium_store 

Source
Expand description

Content-addressed blob and fenced root stores for immutable index segments.

Enable the postgres, turso, or s3 Cargo feature to use [PostgresBlobStore], [TursoBlobStore], or [S3BlobStore], respectively.

Structs§

BlobId
A content identifier for immutable blobs.
DbRoot
Published durable index-root metadata carrying the write lease (see docs/design/log-and-transactor.md).
EncryptedBlobStore
Blob-store decorator that exposes plaintext while storing deterministic authenticated ciphertext.
FsStore
Filesystem-backed content-addressed blob and fenced root store.
GcReport
Result counters from a mark-and-sweep garbage collection pass.
KeyManifest
The keys:<db> root record.
MemoryStore
In-memory blob and root store for tests and embedded use.
ProtectionClassKey
The key a protection class currently seals under.
SegmentCache
Bounded read-through cache. Without a disk configuration it remains a bounded in-memory cache; its default capacity is 64 MiB.
SegmentCacheConfig
Configuration for the peer’s local segment cache.
SegmentCacheMetrics
Lock-free counters and gauges suitable for Prometheus adapters.
StorageKey
One storage data key, wrapped under the manifest’s KEK.

Enums§

DiscoveredStore
An opened, read-only store discovered through the transactor.
DiscoveredStoreSpec
A read-only storage-service connection advertised by a transactor.
StorageAlgorithm
AEAD suite a storage-key epoch is used with.
StorageConnectionError
Failure translating storage information advertised by a transactor.
StorageKeyState
Lifecycle position of one storage-key epoch.
StoreError
Errors raised by store implementations.

Constants§

FORMAT_VERSION
Storage format written by this release.
INDEX_MANIFEST_MAGIC
First line of every index-manifest blob. A flat key-stream blob can never start with these bytes: its first eight bytes are a big-endian key length, and this text decodes to an impossible length.
KEY_MANIFEST_FORMAT_VERSION
Manifest format written by this release.
LOG_RECORDS_PER_EPOCH_LIMIT
Log records to seal under one storage epoch before its key must be rotated.
LOG_RECORDS_PER_EPOCH_WARN
Where KeyManifest::storage_rotation_due starts saying yes.

Traits§

BlobStore
Immutable content-addressed blob storage.
RootStore
Named root pointer storage with compare-and-swap fencing.
SegmentReader
Minimal cache-neutral interface for immutable segment reads.

Functions§

chunk_segment_keys
Splits a sorted key stream into encoded leaf chunks.
db_root_name
Root-store key for a database’s published index root.
decode_index_manifest
Decodes a manifest’s leaf-chunk ids in key order.
decode_segment_keys
Decodes one (u64 big-endian length, key)* chunk or flat segment blob back into its sorted key stream. Inverse of chunk_segment_keys’ per-chunk framing; a pre-format-3 flat snapshot is one such run.
digest
Computes the content id BlobStore::put would assign to bytes.
encode_index_manifest
Encodes a manifest naming children leaf chunks in key order.
encode_segment_chunk
Encodes one chunk’s worth of keys: a run of (u64 big-endian length, key) records — the same framing as a whole pre-format-3 segment, so one decoder reads both.
index_blob_children
Returns the blob ids referenced by an index blob: a manifest’s children, or nothing for a flat (pre-format-3) key stream. Garbage collection and backup share this walk so reachability can never diverge between them.
is_index_manifest
Reports whether blob bytes are an index manifest (vs a flat key stream).
keys_root_name
Root-store key for a database’s key manifest.
load_key_manifest
Reads and validates a database’s key manifest.
mark_and_sweep
Marks blobs reachable from live_roots and deletes every unmarked blob.
mark_and_sweep_retained
Marks reachable blobs and deletes only unreachable blobs older than retention relative to now.
mark_reachable
Adds every blob reachable from live_roots to marked.
meta_root_name
Root-store key for a database’s durable schema and naming metadata.
publish_key_manifest
Publishes a key manifest, fenced on the bytes it was read from.
sweep_unmarked
Deletes every blob absent from marked and older than retention.

Type Aliases§

BlobIdStream
Asynchronous stream of blob identifiers produced by BlobStore::list.