return clusterInfo.getName().substring(0, index);
}
private static ProcessingUnitInstance[] waitForInstances(final String applicationName, final String serviceName, final int minimumNumberOfInstances, final long timeout, final TimeUnit timeunit) {
final ProcessingUnit pu = waitForProcessingUnit(applicationName, serviceName, timeout, timeunit);
pu.waitFor(minimumNumberOfInstances, timeout, timeunit);
final ProcessingUnitInstance[] instances = pu.getInstances();
if (instances.length < minimumNumberOfInstances) {
throw new IllegalStateException("Could not discover " + minimumNumberOfInstances + " "+ serviceName + " instances in application " + applicationName);
}
return instances;