Value-level glue for large payload blob side-channel storage.
Bitcask stores a fixed BlobRef only when the instance threshold is enabled
and the persisted value is large enough. Values that already look like an
encoded BlobRef are also externalized so arbitrary user bytes cannot be
confused with an internal pointer on read.
Summary
Functions
Externalizes value to the blob store when it crosses the threshold.
Externalizes a batch of values with one blob append/fsync when needed.
Materializes an encoded blob ref when the side-channel is enabled.
Materializes a batch of values while loading each exact encoded blob ref once.
Returns the configured blob threshold, or 0 when disabled.
Functions
@spec maybe_externalize(binary(), non_neg_integer(), non_neg_integer(), binary()) :: {:ok, binary()} | {:error, term()}
Externalizes value to the blob store when it crosses the threshold.
@spec maybe_externalize_many(binary(), non_neg_integer(), non_neg_integer(), [ binary() ]) :: {:ok, [binary()]} | {:error, term()}
Externalizes a batch of values with one blob append/fsync when needed.
@spec maybe_materialize(binary(), non_neg_integer(), non_neg_integer(), term()) :: {:ok, term()} | {:error, term()}
Materializes an encoded blob ref when the side-channel is enabled.
When the threshold is disabled, ref-shaped user bytes are ordinary values. This keeps arbitrary 48-byte payloads from being misread as internal refs.
@spec maybe_materialize_many( binary(), non_neg_integer(), non_neg_integer(), [term()] ) :: [ok: term(), error: term()]
Materializes a batch of values while loading each exact encoded blob ref once.
The result stays per-entry so one corrupt or missing blob ref only affects the values that point at that exact ref.
@spec maybe_materialize_many( binary(), non_neg_integer(), non_neg_integer(), [term()], (binary(), non_neg_integer(), Ferricstore.Store.BlobRef.t() -> {:ok, binary()} | {:error, term()}) ) :: [ok: term(), error: term()]
@spec threshold(term()) :: non_neg_integer()
Returns the configured blob threshold, or 0 when disabled.