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

Method round

nodedb-cluster/src/distributed_graph/wcc.rs:121–137  ·  view source on GitHub ↗

Produce outbound merge requests for boundary edges.

(&self)

Source from the content-addressed store, hash-verified

119
120 /// Produce outbound merge requests for boundary edges.
121 pub fn round(&self) -> (HashMap<u32, Vec<(String, String)>>, usize) {
122 let mut outbound: HashMap<u32, Vec<(String, String)>> = HashMap::new();
123
124 for (&local_id, ghost_list) in &self.boundary_edges {
125 let root = find_static(&self.parent, local_id as usize);
126 let label = self.global_labels[root].clone();
127 for (remote_name, target_shard) in ghost_list {
128 outbound
129 .entry(*target_shard)
130 .or_default()
131 .push((remote_name.clone(), label.clone()));
132 }
133 }
134
135 let sent: usize = outbound.values().map(|v| v.len()).sum();
136 (outbound, sent)
137 }
138
139 /// Apply incoming merges. Returns number of labels changed.
140 pub fn apply_merges(&mut self, merges: &[(String, String)]) -> usize {

Callers 14

try_alp_encodeFunction · 0.80
typical_cpu_metricsFunction · 0.80
temperature_readingsFunction · 0.80
large_datasetFunction · 0.80
normalize_frequenciesFunction · 0.80
quantizeFunction · 0.80
quantizeMethod · 0.80
compute_aggregate_binaryFunction · 0.80

Calls 6

find_staticFunction · 0.85
entryMethod · 0.80
sumMethod · 0.80
cloneMethod · 0.45
pushMethod · 0.45
lenMethod · 0.45

Tested by 6

typical_cpu_metricsFunction · 0.64
temperature_readingsFunction · 0.64
large_datasetFunction · 0.64