// start multi-cluster cluster controllers
MockMultiClusterController[] controllers = new MockMultiClusterController[n + n];
for (int i = 0; i < n; i++) {
controllers[i] =
new MockMultiClusterController(_zkaddr, controllerClusterName, "controller_" + i);
controllers[i].syncStart();
}
boolean result =
ClusterStateVerifier.verifyByZkCallback(
new ClusterStateVerifier.BestPossAndExtViewZkVerifier(_zkaddr, controllerClusterName),
30000);
Assert.assertTrue(result, "Controller cluster NOT in ideal state");
// start first cluster
MockParticipant[] participants = new MockParticipant[n];
final String firstClusterName = clusterNamePrefix + "0_0";
for (int i = 0; i < n; i++) {
String instanceName = "localhost0_" + (12918 + i);
participants[i] = new MockParticipant(_zkaddr, firstClusterName, instanceName);
participants[i].syncStart();
}
result =
ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(_zkaddr,
firstClusterName));
Assert.assertTrue(result, "first cluster NOT in ideal state");
// add more controllers to controller cluster
for (int i = 0; i < n; i++) {
String controller = "controller_" + (n + i);
_setupTool.addInstanceToCluster(controllerClusterName, controller);
}
_setupTool.rebalanceStorageCluster(controllerClusterName, clusterNamePrefix + "0", 6);
for (int i = n; i < 2 * n; i++) {
controllers[i] =
new MockMultiClusterController(_zkaddr, controllerClusterName, "controller_" + i);
controllers[i].syncStart();
}
// verify controller cluster
result =