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

Function make_observer

nodedb-cluster/src/cluster_info.rs:219–236  ·  view source on GitHub ↗
(
        lifecycle: ClusterLifecycleTracker,
        peers: Vec<NodeInfo>,
        routing: RoutingTable,
        raft_groups: Vec<GroupStatus>,
    )

Source from the content-addressed store, hash-verified

217 }
218
219 fn make_observer(
220 lifecycle: ClusterLifecycleTracker,
221 peers: Vec<NodeInfo>,
222 routing: RoutingTable,
223 raft_groups: Vec<GroupStatus>,
224 ) -> ClusterObserver {
225 let mut topology = ClusterTopology::new();
226 for p in peers {
227 topology.add_node(p);
228 }
229 ClusterObserver::new(
230 1,
231 lifecycle,
232 Arc::new(RwLock::new(topology)),
233 Arc::new(RwLock::new(routing)),
234 Arc::new(FakeProvider(raft_groups)),
235 )
236 }
237
238 fn gs(group_id: u64, role: &str, leader: u64) -> GroupStatus {
239 GroupStatus {

Callers 3

snapshot_without_groupsFunction · 0.85

Calls 2

FakeProviderClass · 0.85
add_nodeMethod · 0.45

Tested by 3

snapshot_without_groupsFunction · 0.68