Skip to main content

Module object_cache

Module object_cache 

Source
Expand description

shared object range cache

Modules§

backend
blocks
bounded_memory_backend
circuit_breaker
A small, domain-agnostic circuit breaker: closed/open/probing state driven by consecutive-failure counting and a fixed cooldown. Deliberately free of any cache-specific naming so it stays reusable (and so imetric!’s literal-name requirement doesn’t leak into it) — state transitions are returned to the caller, which owns the metrics and logs.
client
foyer_backend
l1_store
memory_backend
metric_tags
Bounded, 'static-safe tag construction for the object cache’s dimensioned metrics (prefix, class).
prefetch
range_cache
validation

Structs§

BoundedMemoryBackend
A byte-weighted, sharded, in-memory RangeCacheBackend bounded to a fixed capacity, built on the standalone foyer-memory crate’s Cache – not the umbrella foyer crate (which FoyerBackend uses via HybridCache, and which transitively pulls in a disk-backed storage engine). foyer-memory is the same in-memory engine HybridCache uses internally for its RAM tier, so this reuses that eviction implementation without the disk-IO dependencies, via LfuConfig rather than FoyerBackend’s LruConfig.
CacheClientConfig
Tunables for CacheClientStore. Default carries the production values, from_env applies operator overrides, and tests construct one directly (short timeouts, near-zero or very long cooldown) instead of sleeping.
CacheClientStore
CircuitBreaker
Gates access to a flaky resource: trips after failure_threshold consecutive unresponsive reports, stays open for a fixed cooldown, then admits exactly one probe request to test recovery.
CircuitBreakerConfig
Tunables for a CircuitBreaker.
L1CacheStore
An ObjectStore adapter fronting origin with a RAM-backed RangeCache.
PrefixPrefetch
Prepends a root prefix to each PrefetchItem’s key before delegating, so a warm keyed by a lake-root-relative path (views/…) targets the same cache key a demand read produces through object_store::PrefixStore (root/views/…). This mirrors, for the prefetch path, what PrefixStore does for reads.

Enums§

RangesReadError
Why reading a streamed /ranges response body failed. Public API surface (re-exported from lib.rs) so the cross-crate integration test can assert on the exact failure kind directly (via send_ranges), rather than inspecting logs or metrics.
RangesSendError
Why send_ranges failed, keeping the header-phase failure, a non-2xx status, and each RangesReadError body-failure kind distinct rather than folding them into one. Public API surface (re-exported from lib.rs) for the same reason as RangesReadError.

Functions§

l1_wrap
Wrap origin with the in-process L1 cache: a RangeCache over the shared bounded RAM backend, namespaced by ns (e.g. "lakehouse", "static") so distinct wrap sites share one RAM budget without their keys colliding.