Fixed-size side-channel reference for large-value blob storage.
Version 1 refs are legacy content-addressed files. Version 2 refs point at a payload range in a shard append segment and carry a checksum so materialized reads and apply-time validation can still prove byte integrity.
Summary
Functions
Decodes a Bitcask value when it is exactly a blob ref.
Encodes a ref as the exact fixed binary stored in Bitcask.
Returns the fixed encoded byte size stored in Bitcask for new refs.
Returns true when a persisted value size can hold an encoded blob ref.
Builds a content-addressed ref from payload bytes.
Builds an append-segment ref from payload bytes and its segment location.
Returns the canonical blob file path for a ref.
Returns true when value is an encoded blob ref.
Returns the shard-local relative blob path for a ref.
Returns the canonical append-segment filename for a segment id.
Returns true when a BlobRef struct has a supported shape.
Verifies that payload bytes match a ref's checksum and size.
Types
@type t() :: %Ferricstore.Store.BlobRef{ checksum: <<_::256>>, offset: non_neg_integer() | nil, segment_id: non_neg_integer() | nil, size: non_neg_integer(), version: 1 | 2 }
Functions
Decodes a Bitcask value when it is exactly a blob ref.
Encodes a ref as the exact fixed binary stored in Bitcask.
@spec encoded_size() :: pos_integer()
Returns the fixed encoded byte size stored in Bitcask for new refs.
Returns true when a persisted value size can hold an encoded blob ref.
Builds a content-addressed ref from payload bytes.
@spec from_segment(binary(), non_neg_integer(), non_neg_integer()) :: t()
Builds an append-segment ref from payload bytes and its segment location.
@spec path(binary(), non_neg_integer(), t()) :: binary()
Returns the canonical blob file path for a ref.
Returns true when value is an encoded blob ref.
Returns the shard-local relative blob path for a ref.
@spec segment_filename(non_neg_integer()) :: binary()
Returns the canonical append-segment filename for a segment id.
Returns true when a BlobRef struct has a supported shape.
Verifies that payload bytes match a ref's checksum and size.