Set<NodeMetadata> nodes = Sets.newHashSet();
Map<?, Exception> executionExceptions = Maps.newHashMap();
Map<NodeMetadata, Throwable> failedNodes = Maps.newHashMap();
for (int i = 0; i < num; i++) {
NodeMetadata nodeMeta = new NodeMetadataImpl(
"ec2", "" + roles + id, "nodeId" + id + i,
location, new URI("http://node" + i),
userMetadata, null, null, null, null, NodeState.RUNNING, 22,
addresses, addresses, null, loginCredentials);
if (i < only) {
nodes.add(nodeMeta);
LOG.info("{} - Node successfully started: {}", roles, nodeMeta.getId());
} else {
failedNodes.put(nodeMeta, new Exception("Simulated failing node"));
LOG.info("{} - Node failing to start: {}", roles, nodeMeta.getId());
}
}
if (failedNodes.size() > 0) {
Image image = new ImageImpl("ec2", "test", "testId", location, new URI("http://node"),
userMetadata, new OperatingSystem(null, null, null, null, "op", true), "description",