Skip to main content

CachePolicy

Trait CachePolicy 

Source
pub trait CachePolicy:
    Debug
    + Send
    + Sync {
    // Required method
    fn find_victim(&self, cnt: usize) -> Vec<EntryID>;

    // Provided methods
    fn notify_insert(&self, _entry_id: &EntryID, _batch_type: CachedBatchType) { ... }
    fn notify_access(&self, _entry_id: &EntryID, _batch_type: CachedBatchType) { ... }
}
Expand description

The cache policy that guides the replacement of LiquidCache

Required Methods§

Source

fn find_victim(&self, cnt: usize) -> Vec<EntryID>

Give cnt amount of entries to evict when cache is full.

Provided Methods§

Source

fn notify_insert(&self, _entry_id: &EntryID, _batch_type: CachedBatchType)

Notify the cache policy that an entry was inserted.

Source

fn notify_access(&self, _entry_id: &EntryID, _batch_type: CachedBatchType)

Notify the cache policy that an entry was accessed.

Implementors§