pub struct FsActionStore { /* private fields */ }Expand description
The persistent two-table store: action records + CAS blobs. See the module docs for the layout and the crash-safe commit protocol.
Implementations§
Source§impl FsActionStore
impl FsActionStore
Sourcepub fn new(root: impl Into<PathBuf>) -> Result<Self>
pub fn new(root: impl Into<PathBuf>) -> Result<Self>
Open (or initialize) a store rooted at root.
Creates the directory skeleton and stamps format.json on first
use; refuses a root whose recorded version is not
FORMAT_VERSION.
Sourcepub fn pin(&self, name: &str, key: &CacheKey) -> Result<()>
pub fn pin(&self, name: &str, key: &CacheKey) -> Result<()>
Pin an action as a GC root under a human-readable name.
Sourcepub fn evict_blob(&self, hash: &ContentHash) -> Result<()>
pub fn evict_blob(&self, hash: &ContentHash) -> Result<()>
Remove a blob (eviction). The action records naming it stay — the value is regenerable by re-running the computation.
Trait Implementations§
Source§impl ActionCache for FsActionStore
impl ActionCache for FsActionStore
Source§fn get_action(&self, key: &CacheKey) -> Result<Option<ActionResult>>
fn get_action(&self, key: &CacheKey) -> Result<Option<ActionResult>>
Look up the record for a provenance key,
None on a miss.Source§fn put_action(&self, result: &ActionResult) -> Result<()>
fn put_action(&self, result: &ActionResult) -> Result<()>
Store a record under its key, replacing any existing one.
Source§impl BlobStore for FsActionStore
impl BlobStore for FsActionStore
Source§impl CacheStore for FsActionStore
impl CacheStore for FsActionStore
Source§fn get(&self, key: &CacheKey) -> Result<Option<Value>>
fn get(&self, key: &CacheKey) -> Result<Option<Value>>
Look up the value stored under
key, None on a miss.Source§fn put(&self, key: &CacheKey, value: &Value) -> Result<()>
fn put(&self, key: &CacheKey, value: &Value) -> Result<()>
Store
value under key, replacing any existing entry.Source§fn put_with_origin(
&self,
key: &CacheKey,
value: &Value,
origin: &Origin,
) -> Result<()>
fn put_with_origin( &self, key: &CacheKey, value: &Value, origin: &Origin, ) -> Result<()>
Store a value together with its provenance. Stores that persist
metadata should override this; the default discards the origin.
Source§fn put_computed(
&self,
key: &CacheKey,
value: &Value,
origin: &Origin,
compute: Duration,
deterministic: bool,
) -> Result<()>
fn put_computed( &self, key: &CacheKey, value: &Value, origin: &Origin, compute: Duration, deterministic: bool, ) -> Result<()>
Store a freshly-computed value with its full provenance record:
origin, wall-clock compute cost, and the producer’s determinism
declaration. Cost-aware eviction needs the compute time — a tiny
value that took days must outlive a huge one that took seconds.
The default discards the extra metadata.
Source§fn exists(&self, key: &CacheKey) -> Result<bool>
fn exists(&self, key: &CacheKey) -> Result<bool>
Whether
key has an entry, without loading the value.Source§fn remove(&self, key: &CacheKey) -> Result<()>
fn remove(&self, key: &CacheKey) -> Result<()>
Delete the entry under
key; absent keys are not an error.Source§fn metadata(&self, key: &CacheKey) -> Result<Option<EntryMeta>>
fn metadata(&self, key: &CacheKey) -> Result<Option<EntryMeta>>
The entry’s [
EntryMeta], without loading the value.§fn get_located(
&self,
key: &CacheKey,
) -> Result<Option<(Value, CacheTier)>, SomaError>
fn get_located( &self, key: &CacheKey, ) -> Result<Option<(Value, CacheTier)>, SomaError>
Like [
CacheStore::get], but also reports which tier served the value. Read moreAuto Trait Implementations§
impl Freeze for FsActionStore
impl RefUnwindSafe for FsActionStore
impl Send for FsActionStore
impl Sync for FsActionStore
impl Unpin for FsActionStore
impl UnsafeUnpin for FsActionStore
impl UnwindSafe for FsActionStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more