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

Method build

nodedb/src/data/executor/handlers/join/hash.rs:52–61  ·  view source on GitHub ↗
(docs: &[(String, Vec<u8>)], keys: &[&str])

Source from the content-addressed store, hash-verified

50
51impl HashIndex {
52 pub(super) fn build(docs: &[(String, Vec<u8>)], keys: &[&str]) -> Self {
53 let state = std::collections::hash_map::RandomState::new();
54 let mut buckets: std::collections::HashMap<u64, Vec<BucketEntry>> =
55 std::collections::HashMap::with_capacity(docs.len());
56 for (i, (_, value)) in docs.iter().enumerate() {
57 let (hash, ranges) = hash_join_key(value, keys, &state);
58 buckets.entry(hash).or_default().push((i, ranges));
59 }
60 Self { buckets, state }
61 }
62
63 /// Find all doc indices whose key bytes match the probe key.
64 pub(super) fn probe(

Callers 9

read_syncMethod · 0.45
prefetch_batchMethod · 0.45
read_filesMethod · 0.45
apply_surrogate_filterFunction · 0.45
schema_2d_f64Function · 0.45
filter_by_surrogatesFunction · 0.45
union_tilesFunction · 0.45

Calls 5

hash_join_keyFunction · 0.85
entryMethod · 0.80
lenMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45

Tested by 3

schema_2d_f64Function · 0.36