MCPcopy Create free account
hub / github.com/cosdata/cosdata / on_cache_miss

Method on_cache_miss

src/models/lru_cache.rs:52–57  ·  view source on GitHub ↗
(&self, counter: u32, key: u64)

Source from the content-addressed store, hash-verified

50 }
51
52 fn on_cache_miss(&self, counter: u32, key: u64) {
53 let i = Self::idx(counter);
54 if self.is_empty(i) {
55 self.inner[i].store(key, Ordering::SeqCst);
56 }
57 }
58
59 fn on_cache_hit(&self, old_counter: u32, new_counter: u32, key: u64) {
60 let i = Self::idx(old_counter);

Callers 3

insertMethod · 0.80
get_or_insertMethod · 0.80
test_eviction_indexFunction · 0.80

Calls 1

is_emptyMethod · 0.45

Tested by 1

test_eviction_indexFunction · 0.64