HelixAdmin admin = new ZKHelixAdmin(zkAddress);
admin.addCluster(clusterName, true);
StateModelConfigGenerator generator = new StateModelConfigGenerator();
admin.addStateModelDef(clusterName, "OnlineOffline",
new StateModelDefinition(generator.generateConfigForOnlineOffline()));
admin.addResource(clusterName, lockGroupName, numPartitions, "OnlineOffline",
RebalanceMode.FULL_AUTO.toString());
admin.rebalance(clusterName, lockGroupName, 1);
for (int i = 0; i < numInstances; i++) {
final String instanceName = "localhost_" + (12000 + i);
processArray[i] = new Thread(new Runnable() {