(max_entries: usize, max_memory_bytes: usize, default_ttl: Duration)
| 378 | |
| 379 | impl SubqueryCache { |
| 380 | pub fn new(max_entries: usize, max_memory_bytes: usize, default_ttl: Duration) -> Self { |
| 381 | Self { |
| 382 | entries: Arc::new(RwLock::new(HashMap::new())), |
| 383 | max_entries, |
| 384 | max_memory_bytes, |
| 385 | current_memory: Arc::new(RwLock::new(0)), |
| 386 | stats: Arc::new(RwLock::new(SubqueryCacheStats::default())), |
| 387 | default_ttl, |
| 388 | boolean_index: Arc::new(RwLock::new(HashMap::new())), |
| 389 | scalar_index: Arc::new(RwLock::new(HashMap::new())), |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | /// Get cached subquery result |
| 394 | pub fn get(&self, key: &SubqueryCacheKey) -> Option<SubqueryResult> { |
nothing calls this directly
no outgoing calls
no test coverage detected