Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.TemplateBuilder.build()


        if (hardwareId != null) {
            builder.hardwareId(hardwareId);
        }

        try {
            Set<? extends NodeMetadata> nodeMetadatas = computeService.createNodesInGroup(group, 1, builder.build());
            exchange.getOut().setBody(nodeMetadatas);
            exchange.getOut().setHeaders(exchange.getIn().getHeaders());
        } catch (RunNodesException e) {
            throw new CamelException("Error creating jclouds node.", e);
        }
View Full Code Here


   public void createNodes() throws RunNodesException {
      try {
         TemplateBuilder builder = computeContext.getComputeService().templateBuilder();
         if (template != null)
            builder.from(template);
         nodes = computeContext.getComputeService().createNodesInGroup(group, 2, builder.build());
      } catch (RunNodesException e) {
         nodes = e.getSuccessfulNodes();
         throw e;
      }
   }
View Full Code Here

    }

    TemplateBuilder templateBuilder = computeService.templateBuilder().from(
        instanceTemplate.getTemplate() != null ? instanceTemplate.getTemplate() :
        clusterSpec.getTemplate());
    Template template = templateBuilder.build();
    template.getOptions().runScript(bootstrap);
    return setSpotInstancePriceIfSpecified(
      computeService.getContext(), clusterSpec, template, instanceTemplate
    );
  }
View Full Code Here

            options.as(EC2TemplateOptions.class).keyPair(config.getKeyPair());
        }

        template.options(options);

        Set<? extends NodeMetadata> tag = computeService.createNodesInGroup(config.getTagPrefix() + id, 1, template.build());
        if (!useConfiguredPrivateKey(config)) {
            System.out.println("In case you need it, this is the key to ssh to " + id + ":\n" + tag.iterator().next().getCredentials().credential);
        }

        LoginCredentials.Builder loginBuilder = LoginCredentials.builder();
View Full Code Here

   
    new TemplateBuilderStrategy().configureTemplateBuilder(clusterSpec,
        templateBuilder);
   
    LOG.info("Configuring template");
    Template template = templateBuilder.build();
   
    InstanceTemplate instanceTemplate = clusterSpec.getInstanceTemplate(ZOOKEEPER_ROLE);
    checkNotNull(instanceTemplate);
    int ensembleSize = instanceTemplate.getNumberOfInstances();
    Set<? extends NodeMetadata> nodeMap;
View Full Code Here

    new TemplateBuilderStrategy().configureTemplateBuilder(clusterSpec,
        templateBuilder);

    LOG.info("Configuring template");
    Template template = templateBuilder.build();

    InstanceTemplate instanceTemplate = clusterSpec
        .getInstanceTemplate(CASSANDRA_ROLE);
    checkNotNull(instanceTemplate);
    int clusterSize = instanceTemplate.getNumberOfInstances();
View Full Code Here

    }

    TemplateBuilder templateBuilder = computeService.templateBuilder().from(
        instanceTemplate.getTemplate() != null ? instanceTemplate.getTemplate() :
        clusterSpec.getTemplate());
    Template template = templateBuilder.build();
    template.getOptions().runScript(bootstrap);
    return setSpotInstancePriceIfSpecified(
      computeService.getContext(), clusterSpec, template, instanceTemplate
    );
  }
View Full Code Here

    when(computeService.getContext()).thenReturn(serviceContext);
    when(serviceContext.getBackendType()).thenReturn(TypeToken.class.cast(TypeToken.of(Context.class)));
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.from((TemplateBuilderSpec) any())).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
    when(template.getOptions()).thenReturn(templateOptions);
   
    // here is a scenario when jt+nn fails once, then the retry is successful
    // and from the dn+tt one node fails, then the retry is successful
    Map<Set<String>, Stack<Integer>> reaction = Maps.newHashMap();
View Full Code Here

    when(computeService.getContext()).thenReturn(serviceContext);
    when(serviceContext.getBackendType()).thenReturn(TypeToken.class.cast(TypeToken.of(Context.class)));
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.from((TemplateBuilderSpec) any())).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
    when(template.getOptions()).thenReturn(templateOptions);
   
    // here is a scenario when jt+nn does not fail
    // but the dn+tt one node fails 3, then in the retry fails 2
    // at the end result, the cluster will fail, throwing IOException
View Full Code Here

    when(computeService.getContext()).thenReturn(serviceContext);
    when(serviceContext.getBackendType()).thenReturn(TypeToken.class.cast(TypeToken.of(Context.class)));
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.from((TemplateBuilderSpec) any())).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
    when(template.getOptions()).thenReturn(templateOptions);
   
    Map<Set<String>, Stack<Integer>> reaction = Maps.newHashMap();
    Stack<Integer> nnStack = new Stack<Integer>();
    nnStack.push(new Integer(1));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.