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

Method evict_entries

datafusion/execution/src/cache/list_files_cache.rs:270–283  ·  view source on GitHub ↗

Evicts entries from the LRU cache until `memory_used` is lower than `memory_limit`.

(&mut self)

Source from the content-addressed store, hash-verified

268
269 /// Evicts entries from the LRU cache until `memory_used` is lower than `memory_limit`.
270 fn evict_entries(&mut self) {
271 while self.memory_used > self.memory_limit {
272 if let Some(removed) = self.lru_queue.pop() {
273 self.memory_used -= removed.1.size_bytes;
274 } else {
275 // cache is empty while memory_used > memory_limit, cannot happen
276 debug_assert!(
277 false,
278 "cache is empty while memory_used > memory_limit, cannot happen"
279 );
280 return;
281 }
282 }
283 }
284
285 /// Removes an entry from the cache and returns it, if it exists.
286 fn remove(&mut self, k: &TableScopedPath) -> Option<CachedFileList> {

Callers 3

putMethod · 0.45
update_cache_limitMethod · 0.45
update_cache_ttlMethod · 0.45

Calls 1

popMethod · 0.45

Tested by

no test coverage detected