@Override public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, Template template) throws RunNodesException { checkNotNull(group, "group cannot be null"); checkNotNull(template.getLocation(), "location"); logger.debug(">> running %d node%s group(%s) location(%s) image(%s) hardwareProfile(%s) options(%s)", count, count > 1 ? "s" : "", group, template.getLocation().getId(), template.getImage().getId(), template .getHardware().getId(), template.getOptions()); Set<NodeMetadata> goodNodes = newLinkedHashSet(); Map<NodeMetadata, Exception> badNodes = newLinkedHashMap(); Multimap<NodeMetadata, CustomizationResponse> customizationResponses = LinkedHashMultimap.create(); if (template.getOptions().getRunScript() != null) initAdminAccess.visit(template.getOptions().getRunScript()); Map<?, ListenableFuture<Void>> responses = runNodesAndAddToSetStrategy.execute(group, count, template, goodNodes, badNodes, customizationResponses); Map<?, Exception> executionExceptions; try { executionExceptions = awaitCompletion(responses, userExecutor, null, logger, "createNodesInGroup(" + group + ")"); } catch (TimeoutException te) { throw propagate(te); } Function<NodeMetadata, NodeMetadata> fn = persistNodeCredentials.always(template.getOptions().getRunScript()); badNodes = Maps2.transformKeys(badNodes, fn); goodNodes = ImmutableSet.copyOf(Iterables.transform(goodNodes, fn)); if (!executionExceptions.isEmpty() || !badNodes.isEmpty()) { throw new RunNodesException(group, count, template, goodNodes, executionExceptions, badNodes); } return goodNodes; }
@Override public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, Template template) throws RunNodesException { checkNotNull(group, "group cannot be null"); checkNotNull(template.getLocation(), "location"); logger.debug(">> running %d node%s group(%s) location(%s) image(%s) hardwareProfile(%s) options(%s)", count, count > 1 ? "s" : "", group, template.getLocation().getId(), template.getImage().getId(), template .getHardware().getId(), template.getOptions()); Set<NodeMetadata> goodNodes = newLinkedHashSet(); Map<NodeMetadata, Exception> badNodes = newLinkedHashMap(); Multimap<NodeMetadata, CustomizationResponse> customizationResponses = LinkedHashMultimap.create(); if (template.getOptions().getRunScript() != null) initAdminAccess.visit(template.getOptions().getRunScript()); Map<?, ListenableFuture<Void>> responses = runNodesAndAddToSetStrategy.execute(group, count, template, goodNodes, badNodes, customizationResponses); Map<?, Exception> executionExceptions; try { executionExceptions = awaitCompletion(responses, userExecutor, null, logger, "createNodesInGroup(" + group + ")"); } catch (TimeoutException te) { throw propagate(te); } Function<NodeMetadata, NodeMetadata> fn = persistNodeCredentials.always(template.getOptions().getRunScript()); badNodes = Maps2.transformKeys(badNodes, fn); goodNodes = ImmutableSet.copyOf(Iterables.transform(goodNodes, fn)); if (executionExceptions.size() > 0 || badNodes.size() > 0) { throw new RunNodesException(group, count, template, goodNodes, executionExceptions, badNodes); } return goodNodes; }
@Override public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, Template template) throws RunNodesException { checkNotNull(group, "group cannot be null"); checkNotNull(template.getLocation(), "location"); logger.debug(">> running %d node%s group(%s) location(%s) image(%s) hardwareProfile(%s) options(%s)", count, count > 1 ? "s" : "", group, template.getLocation().getId(), template.getImage().getId(), template .getHardware().getId(), template.getOptions()); Set<NodeMetadata> goodNodes = newLinkedHashSet(); Map<NodeMetadata, Exception> badNodes = newLinkedHashMap(); Multimap<NodeMetadata, CustomizationResponse> customizationResponses = LinkedHashMultimap.create(); if (template.getOptions().getRunScript() != null) initAdminAccess.visit(template.getOptions().getRunScript()); Map<?, ListenableFuture<Void>> responses = runNodesAndAddToSetStrategy.execute(group, count, template, goodNodes, badNodes, customizationResponses); Map<?, Exception> executionExceptions; try { executionExceptions = awaitCompletion(responses, userExecutor, null, logger, "createNodesInGroup(" + group + ")"); } catch (TimeoutException te) { throw propagate(te); } Function<NodeMetadata, NodeMetadata> fn = persistNodeCredentials.always(template.getOptions().getRunScript()); badNodes = Maps2.transformKeys(badNodes, fn); goodNodes = ImmutableSet.copyOf(Iterables.transform(goodNodes, fn)); if (executionExceptions.size() > 0 || badNodes.size() > 0) { throw new RunNodesException(group, count, template, goodNodes, executionExceptions, badNodes); } return goodNodes; }
@Override public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, Template template) throws RunNodesException { checkNotNull(group, "group cannot be null"); checkNotNull(template.getLocation(), "location"); logger.debug(">> running %d node%s group(%s) location(%s) image(%s) hardwareProfile(%s) options(%s)", count, count > 1 ? "s" : "", group, template.getLocation().getId(), template.getImage().getId(), template .getHardware().getId(), template.getOptions()); Set<NodeMetadata> goodNodes = newLinkedHashSet(); Map<NodeMetadata, Exception> badNodes = newLinkedHashMap(); Multimap<NodeMetadata, CustomizationResponse> customizationResponses = LinkedHashMultimap.create(); if (template.getOptions().getRunScript() != null) initAdminAccess.visit(template.getOptions().getRunScript()); Map<?, ListenableFuture<Void>> responses = runNodesAndAddToSetStrategy.execute(group, count, template, goodNodes, badNodes, customizationResponses); Map<?, Exception> executionExceptions; try { executionExceptions = awaitCompletion(responses, userExecutor, null, logger, "createNodesInGroup(" + group + ")"); } catch (TimeoutException te) { throw propagate(te); } Function<NodeMetadata, NodeMetadata> fn = persistNodeCredentials.always(template.getOptions().getRunScript()); badNodes = Maps2.transformKeys(badNodes, fn); goodNodes = ImmutableSet.copyOf(Iterables.transform(goodNodes, fn)); if (!executionExceptions.isEmpty() || !badNodes.isEmpty()) { throw new RunNodesException(group, count, template, goodNodes, executionExceptions, badNodes); } return goodNodes; }