Produce outbound merge requests for boundary edges.
(&self)
| 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 { |