MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / find_boolean_matches

Method find_boolean_matches

graphlite/src/cache/subquery_cache.rs:495–513  ·  view source on GitHub ↗

Find potential cache hits for EXISTS subqueries

(&self, subquery_hash: u64)

Source from the content-addressed store, hash-verified

493
494 /// Find potential cache hits for EXISTS subqueries
495 pub fn find_boolean_matches(&self, subquery_hash: u64) -> Vec<(SubqueryCacheKey, bool)> {
496 let mut matches = Vec::new();
497
498 if let Some(keys) = self.boolean_index.read().unwrap().get(&subquery_hash) {
499 let entries = self.entries.read().unwrap();
500
501 for key in keys {
502 if let Some(entry) = entries.get(key) {
503 if entry.is_valid() {
504 if let Some(boolean_result) = entry.result.as_boolean() {
505 matches.push((key.clone(), boolean_result));
506 }
507 }
508 }
509 }
510 }
511
512 matches
513 }
514
515 /// Invalidate entries by graph version
516 pub fn invalidate_by_graph_version(&self, version: u64) {

Callers 1

Calls 5

unwrapMethod · 0.80
cloneMethod · 0.80
getMethod · 0.45
is_validMethod · 0.45
as_booleanMethod · 0.45

Tested by

no test coverage detected