pub struct BlobCachePool { /* private fields */ }Expand description
Process-shared blob cache. Construct once per Repository (or once
per daemon process) and hand the same Arc<BlobCachePool> to every
crate::ContentAddressedMount that wants to share its warm
state with sibling mounts.
Clone-cheap: it’s just Arc<Inner> under the hood.
Implementations§
Source§impl BlobCachePool
impl BlobCachePool
Sourcepub fn with_default_capacity() -> Self
pub fn with_default_capacity() -> Self
Construct a pool with DEFAULT_BLOB_CACHE_BYTES cap. Suitable
for tests, CLI one-shots, and any caller that doesn’t have a
sizing strategy.
Sourcepub fn with_capacity(cap_bytes: usize) -> Self
pub fn with_capacity(cap_bytes: usize) -> Self
Construct a pool with an explicit byte cap. Daemon callers should size this from physical RAM (see module docs).
Sourcepub fn clear(&self)
pub fn clear(&self)
Drop every cached entry. Used by benchmarks that need to measure the true cold path.
Sourcepub fn resident_bytes(&self) -> usize
pub fn resident_bytes(&self) -> usize
Current resident bytes across all entries. Cheap (single lock acquire) but not free — meant for diagnostics, not hot-path budgeting.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Number of distinct blobs currently cached. Same caveat as
resident_bytes.
Sourcepub fn stats(&self) -> BlobCacheStats
pub fn stats(&self) -> BlobCacheStats
Cumulative hit / miss / insert counters since the pool was
constructed. Useful for sizing decisions: a pool with
inserts >> hits is undersized, a pool with hits >> inserts
is right-sized for its workload.