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

Function hot_split_plan

nodedb-cluster/src/rebalance_scheduler.rs:353–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

351
352 #[test]
353 fn hot_split_plan() {
354 let mut topo = ClusterTopology::new();
355 let addr1: SocketAddr = "127.0.0.1:9000".parse().unwrap();
356 let addr2: SocketAddr = "127.0.0.1:9001".parse().unwrap();
357 topo.add_node(NodeInfo::new(1, addr1, NodeState::Active));
358 topo.add_node(NodeInfo::new(2, addr2, NodeState::Active));
359
360 // uniform(2, ...) creates data groups 1 and 2 (+ metadata group 0).
361 let routing = RoutingTable::uniform(2, &[1, 2], 1);
362 let moves = plan_hot_split(1, &routing, &topo).unwrap();
363 // Data group 1 has 512 vShards → split moves up to 256.
364 assert!(!moves.is_empty());
365 assert!(moves.len() <= 512);
366 }
367}

Callers

nothing calls this directly

Calls 3

plan_hot_splitFunction · 0.85
parseMethod · 0.45
add_nodeMethod · 0.45

Tested by

no test coverage detected