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

Method get

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

Gets an entry from the cache, checking for expiration. Returns the cached file list if it exists and hasn't expired. If the entry has expired, it is removed from the cache.

(&mut self, key: &TableScopedPath, now: Instant)

Source from the content-addressed store, hash-verified

202 /// Returns the cached file list if it exists and hasn't expired.
203 /// If the entry has expired, it is removed from the cache.
204 fn get(&mut self, key: &TableScopedPath, now: Instant) -> Option<CachedFileList> {
205 let entry = self.lru_queue.get(key)?;
206
207 // Check expiration
208 if let Some(exp) = entry.expires
209 && now > exp
210 {
211 self.remove(key);
212 return None;
213 }
214
215 Some(entry.metas.clone())
216 }
217
218 /// Checks if the respective entry is currently cached.
219 ///

Callers 6

test_basic_operationsFunction · 0.45
test_prefix_filteringFunction · 0.45
test_nested_partitionsFunction · 0.45

Calls 3

nowMethod · 0.80
removeMethod · 0.45
cloneMethod · 0.45

Tested by 6

test_basic_operationsFunction · 0.36
test_prefix_filteringFunction · 0.36
test_nested_partitionsFunction · 0.36