| 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 { |