MockParticipant[] participants = new MockParticipant[nodeNr];
for (int i = 0; i < nodeNr - 1; i++)
{
String instanceName = "localhost_" + (12918 + i);
participants[i] = new MockParticipant(clusterName, instanceName, ZK_ADDR);
participants[i].syncStart();
// new Thread(participants[i]).start();
}
result =
ClusterStateVerifier.verifyByPolling(new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR,
clusterName));
Assert.assertTrue(result);
// check if controller_0 has message listener for localhost_12918
String msgPath = PropertyPathConfig.getPath(PropertyType.MESSAGES, clusterName, "localhost_12918");
int numberOfListeners = ZkTestHelper.numberOfListeners(ZK_ADDR, msgPath);
// System.out.println("numberOfListeners(" + msgPath + "): " + numberOfListeners);
Assert.assertEquals(numberOfListeners, 2); // 1 of participant, and 1 of controller
_gSetupTool.addInstanceToCluster(clusterName, "localhost_12919");
_gSetupTool.rebalanceStorageCluster(clusterName, "TestDB0", 2);
participants[nodeNr - 1] =
new MockParticipant(clusterName, "localhost_12919", ZK_ADDR);
participants[nodeNr - 1].syncStart();
// new Thread(participants[nodeNr - 1]).start();
result =
ClusterStateVerifier.verifyByPolling(new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR,