final String firstClusterName = clusterNamePrefix + "0_0";
for (int i = 0; i < n; i++)
{
String instanceName = "localhost0_" + (12918 + i);
participants[i] =
new MockParticipant(firstClusterName, instanceName, ZK_ADDR, null);
participants[i].syncStart();
}
result =
ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
firstClusterName));
Assert.assertTrue(result, "first cluster NOT in ideal state");
// stop current leader in controller cluster
ZkBaseDataAccessor<ZNRecord> baseAccessor =
new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(controllerClusterName, baseAccessor);
Builder keyBuilder = accessor.keyBuilder();
LiveInstance leader = accessor.getProperty(keyBuilder.controllerLeader());
String leaderName = leader.getId();
int j = Integer.parseInt(leaderName.substring(leaderName.lastIndexOf('_') + 1));
controllers[j].syncStop();
// setup the second cluster
MockParticipant[] participants2 = new MockParticipant[n];
final String secondClusterName = clusterNamePrefix + "0_1";
for (int i = 0; i < n; i++)
{
String instanceName = "localhost1_" + (12918 + i);
participants2[i] =
new MockParticipant(secondClusterName, instanceName, ZK_ADDR, null);
participants2[i].syncStart();
}
result =
ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,