Skip to main content

DecodedPageCache

Struct DecodedPageCache 

Source
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

Source

pub fn new(capacity_bytes: u64) -> Self

Source

pub fn stats(&self) -> CacheStats

Cumulative hit/miss counts since construction (or the last reset_stats).

Source

pub fn reset_stats(&self)

Zero the hit/miss counters.

Source

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.

Source

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.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn used_bytes(&self) -> u64

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.