MCPcopy Create free account
hub / github.com/apache/datafusion / evict_entries

Method evict_entries

datafusion/execution/src/cache/file_statistics_cache.rs:150–172  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

148 }
149
150 fn evict_entries(&mut self) {
151 while self.memory_used > self.memory_limit {
152 if let Some(removed) = self.lru_queue.pop() {
153 let mut ctx = DFHeapSizeCtx::default();
154 self.memory_used -= removed.0.heap_size(&mut ctx);
155 self.memory_used -= removed.1.heap_size(&mut ctx);
156 } else {
157 // cache is empty while memory_used > memory_limit, cannot happen
158 log::error!(
159 "File statistics cache memory accounting bug: memory_used={} but cache is empty. \
160 Please report this to the Apache DataFusion developers.",
161 self.memory_used
162 );
163 debug_assert!(
164 false,
165 "memory_used={} but cache is empty",
166 self.memory_used
167 );
168 self.memory_used = 0;
169 return;
170 }
171 }
172 }
173}
174impl CacheAccessor<TableScopedPath, CachedFileMetadata> for DefaultFileStatisticsCache {
175 fn get(&self, key: &TableScopedPath) -> Option<CachedFileMetadata> {

Callers 2

putMethod · 0.45
update_cache_limitMethod · 0.45

Calls 2

popMethod · 0.45
heap_sizeMethod · 0.45

Tested by

no test coverage detected