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§
Sourcefn find_victim(&self, cnt: usize) -> Vec<EntryID>
fn find_victim(&self, cnt: usize) -> Vec<EntryID>
Give cnt amount of entries to evict when cache is full.
Provided Methods§
Sourcefn notify_insert(&self, _entry_id: &EntryID, _batch_type: CachedBatchType)
fn notify_insert(&self, _entry_id: &EntryID, _batch_type: CachedBatchType)
Notify the cache policy that an entry was inserted.
Sourcefn notify_access(&self, _entry_id: &EntryID, _batch_type: CachedBatchType)
fn notify_access(&self, _entry_id: &EntryID, _batch_type: CachedBatchType)
Notify the cache policy that an entry was accessed.