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

Method dispatch

nodedb-cluster/tests/rebalancer_loop.rs:71–81  ·  view source on GitHub ↗
(&self, mv: PlannedMove)

Source from the content-addressed store, hash-verified

69#[async_trait]
70impl MigrationDispatcher for DirectDispatcher {
71 async fn dispatch(&self, mv: PlannedMove) -> Result<()> {
72 // Simulate a completed migration by flipping the group
73 // leader to the target node.
74 {
75 let mut rt = self.routing.write().unwrap_or_else(|p| p.into_inner());
76 rt.set_leader(mv.source_group, mv.target_node);
77 }
78 self.calls.lock().unwrap().push(mv);
79 self.fired.store(true, Ordering::SeqCst);
80 Ok(())
81 }
82}
83
84fn topo(nodes: &[u64]) -> Arc<RwLock<ClusterTopology>> {

Callers

nothing calls this directly

Calls 5

set_leaderMethod · 0.80
lockMethod · 0.80
writeMethod · 0.45
pushMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected