Skip to main content

Module content_addressed_cache_v2

Module content_addressed_cache_v2 

Source
Expand description

Content-Addressed Cache V2 — multi-tier eviction with admission control.

Provides a production-grade, purely in-memory cache keyed by 32-byte CIDs with:

  • Hot tier: LRU eviction, short TTL, fastest access
  • Warm tier: LFU eviction, longer TTL, larger capacity
  • Bloom-filter admission gate: three FNV-1a hash functions prevent one-hit wonders
  • Eviction log: bounded ring of the last 500 eviction events
  • TTL sweep: single-pass expiry across both tiers
  • Warm drain: simulate write-back of least-frequently-used 25% to slower storage

Structs§

Cac2CacheConfig
Configuration knobs for ContentAddressedCacheV2.
Cac2CacheStats
Snapshot of cache statistics.
Cac2Cid
32-byte content identifier — a fixed-size, copy-friendly newtype.
Cac2Entry
Single entry stored in the hot or warm tier.
Cac2EvictionRecord
A record of a single eviction event.
ContentAddressedCacheV2
Production-grade content-addressed cache with hot/warm tiering, Bloom-filter admission control, and rich eviction accounting.

Enums§

Cac2EvictionReason
Why an entry was removed from the cache.
Cac2Tier
Cache tier designation.

Type Aliases§

Cac2ContentAddressedCacheV2
Alias for the main cache type.