MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / rebuild_from_store

Function rebuild_from_store

nodedb/src/engine/graph/csr/rebuild.rs:75–88  ·  view source on GitHub ↗
(store: &EdgeStore)

Source from the content-addressed store, hash-verified

73/// Used by test harnesses that insert under one tenant at a time.
74#[cfg(test)]
75pub fn rebuild_from_store(store: &EdgeStore) -> crate::Result<CsrIndex> {
76 use std::collections::hash_map::Entry;
77
78 let mut sharded = rebuild_sharded_from_store_as_of(store, None)?;
79 let tid = sharded
80 .iter()
81 .map(|(tid, _)| *tid)
82 .next()
83 .unwrap_or_else(|| TenantId::new(0));
84 match sharded.entry(tid) {
85 Entry::Occupied(entry) => Ok(entry.remove()),
86 Entry::Vacant(_) => Ok(CsrIndex::new()),
87 }
88}

Callers 3

make_social_graphFunction · 0.85
extract_empty_propertiesFunction · 0.85

Calls 5

entryMethod · 0.80
nextMethod · 0.45
iterMethod · 0.45
removeMethod · 0.45

Tested by 2

extract_empty_propertiesFunction · 0.68