btree_ondisk/cache/
null.rs

1use std::io::Result;
2use std::sync::atomic::Ordering;
3use crate::NodeCache;
4use super::NodeTieredCacheStats;
5
6#[derive(Clone)]
7pub struct NullNodeCache;
8
9impl<P: Send> NodeCache<P> for NullNodeCache {
10    fn push(&self, _p: &P, _data: &[u8]) {
11    }
12
13    async fn load(&self, _p: P, _data: &mut [u8]) -> Result<bool> {
14        Ok(false)
15    }
16    
17    fn invalid(&self, _p: &P) {
18    }
19
20    fn evict(&self) {
21    }
22
23    fn get_stats(&self) -> NodeTieredCacheStats {
24        let stats = NodeTieredCacheStats::default();
25        let _ = stats.total_push.load(Ordering::SeqCst);
26        let _ = stats.total_load.load(Ordering::SeqCst);
27        let _ = stats.total_hit.load(Ordering::SeqCst);
28        let _ = stats.total_remove.load(Ordering::SeqCst);
29        stats
30    }
31
32    fn shutdown(&self) {
33    }
34}