pub struct DecodedPageCache { /* private fields */ }Expand description
Bounded LRU/CLOCK cache of decoded columnar pages (Phase 15.4). The
PageCache above holds raw (ciphertext) page bytes; this second layer
caches the post-decompress, post-decrypt typed page so a repeat scan skips
decode entirely. Pages are immutable per (run_id, column_id, page_seq)
identity (keyed via [crate::sorted_run::page_cache_key]), so there is no
MVCC/invalidation concern — runs never change, and a rewritten page lives in
a different run (different id) and simply misses here.
Implementations§
Source§impl DecodedPageCache
impl DecodedPageCache
pub fn new(capacity_bytes: u64) -> Self
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Cumulative hit/miss counts since construction (or the last
reset_stats).
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Zero the hit/miss counters.
Sourcepub fn try_get(&self, key: &[u8; 32]) -> Option<Arc<NativeColumn>>
pub fn try_get(&self, key: &[u8; 32]) -> Option<Arc<NativeColumn>>
Non-blocking probe used by the parallel scan path (&self, no write
lock) — returns the cached decoded page on hit, None on miss.
Sourcepub fn insert(&mut self, key: [u8; 32], col: Arc<NativeColumn>)
pub fn insert(&mut self, key: [u8; 32], col: Arc<NativeColumn>)
Insert a decoded page (replaces any entry with the same key). Evicts cold entries (CLOCK) when over capacity.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn used_bytes(&self) -> u64
Auto Trait Implementations§
impl !Freeze for DecodedPageCache
impl RefUnwindSafe for DecodedPageCache
impl Send for DecodedPageCache
impl Sync for DecodedPageCache
impl Unpin for DecodedPageCache
impl UnsafeUnpin for DecodedPageCache
impl UnwindSafe for DecodedPageCache
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more