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

Method contains_key

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

Checks if the respective entry is currently cached. If the entry has expired by `now` it is removed from the cache. The LRU queue is not updated.

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

Source from the content-addressed store, hash-verified

221 ///
222 /// The LRU queue is not updated.
223 fn contains_key(&mut self, k: &TableScopedPath, now: Instant) -> bool {
224 let Some(entry) = self.lru_queue.peek(k) else {
225 return false;
226 };
227
228 match entry.expires {
229 Some(exp) if now > exp => {
230 self.remove(k);
231 false
232 }
233 _ => true,
234 }
235 }
236
237 /// Adds a new key-value pair to cache expiring at `now` + the TTL.
238 ///

Callers

nothing calls this directly

Calls 3

peekMethod · 0.80
nowMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected