Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.TemplateBuilder


        clusterSpec.getClusterUser(),
        clusterSpec.getPublicKey(),
        clusterSpec.getPrivateKey(),
        statementBuilder);

    TemplateBuilder templateBuilder = computeService.templateBuilder()
      .options(runScript(runScript));
    strategy.configureTemplateBuilder(clusterSpec, templateBuilder);

    return setSpotInstancePriceIfSpecified(
      computeService.getContext(), clusterSpec, templateBuilder.build());
  }
View Full Code Here


  }
 
  @Test
  public void testImageIdIsPassedThrough() {
    spec.setImageId("my-image-id");
    TemplateBuilder builder = mock(TemplateBuilder.class);
    strategy.configureTemplateBuilder(spec, builder);
    verify(builder).imageId("my-image-id");
  }
View Full Code Here

  }
 
  @Test
  public void testHardwareIdIsPassedThrough() {
    spec.setHardwareId("my-hardware-id");
    TemplateBuilder builder = mock(TemplateBuilder.class);
    strategy.configureTemplateBuilder(spec, builder);
    verify(builder).hardwareId("my-hardware-id");
  }
View Full Code Here

  }

  @Test
  public void testLocationIdIsPassedThrough() {
    spec.setLocationId("my-location-id");
    TemplateBuilder builder = mock(TemplateBuilder.class);
    strategy.configureTemplateBuilder(spec, builder);
    verify(builder).locationId("my-location-id");
  }
View Full Code Here

    handlerMap.put("hadoop-tasktracker", handler);

    Function<ClusterSpec, ComputeServiceContext> getCompute = mock(Function.class);
    ComputeServiceContext serviceContext = mock(ComputeServiceContext.class);
    ComputeService computeService = mock(ComputeService.class);
    TemplateBuilder templateBuilder = mock(TemplateBuilder.class);
    Template template = mock(Template.class);

    when(getCompute.apply(clusterSpec)).thenReturn(serviceContext);
    when(serviceContext.getComputeService()).thenReturn(computeService);
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
   
    // 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();
    Stack<Integer> jtnnStack = new Stack<Integer>();
View Full Code Here

    handlerMap.put("hadoop-tasktracker", handler);

    Function<ClusterSpec, ComputeServiceContext> getCompute = mock(Function.class);
    ComputeServiceContext serviceContext = mock(ComputeServiceContext.class);
    ComputeService computeService = mock(ComputeService.class);
    TemplateBuilder templateBuilder = mock(TemplateBuilder.class);
    Template template = mock(Template.class);

    when(getCompute.apply(clusterSpec)).thenReturn(serviceContext);
    when(serviceContext.getComputeService()).thenReturn(computeService);
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
   
    // 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
    Map<Set<String>, Stack<Integer>> reaction = Maps.newHashMap();
View Full Code Here

         // if the backend cannot provide a decent template we'll have problems with looking for
         // images, just provide a custom templatebuilder that returns our custom template.
         compute.get().templateBuilder().build();
         return compute.get().templateBuilder();
      } catch (Exception e) {
         return new TemplateBuilder() {

            @Override
            public TemplateBuilder smallest() {
               return this;
            }
View Full Code Here

    if (LOG.isDebugEnabled()) {
      LOG.debug("Running script:\n{}", runScript.render(OsFamily.UNIX));
    }

    TemplateBuilder templateBuilder = computeService.templateBuilder()
      .options(runScript(runScript));
    strategy.configureTemplateBuilder(clusterSpec, templateBuilder);

    return setSpotInstancePriceIfSpecified(
      computeService.getContext(), clusterSpec, templateBuilder.build()
    );
  }
View Full Code Here

    handlerMap.put("hadoop-tasktracker", handler);

    Function<ClusterSpec, ComputeServiceContext> getCompute = mock(Function.class);
    ComputeServiceContext serviceContext = mock(ComputeServiceContext.class);
    ComputeService computeService = mock(ComputeService.class);
    TemplateBuilder templateBuilder = mock(TemplateBuilder.class);
    Template template = mock(Template.class);

    when(getCompute.apply(clusterSpec)).thenReturn(serviceContext);
    when(serviceContext.getComputeService()).thenReturn(computeService);
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
   
    // 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();
    Stack<Integer> jtnnStack = new Stack<Integer>();
View Full Code Here

    handlerMap.put("hadoop-tasktracker", handler);

    Function<ClusterSpec, ComputeServiceContext> getCompute = mock(Function.class);
    ComputeServiceContext serviceContext = mock(ComputeServiceContext.class);
    ComputeService computeService = mock(ComputeService.class);
    TemplateBuilder templateBuilder = mock(TemplateBuilder.class);
    Template template = mock(Template.class);

    when(getCompute.apply(clusterSpec)).thenReturn(serviceContext);
    when(serviceContext.getComputeService()).thenReturn(computeService);
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
   
    // 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
    Map<Set<String>, Stack<Integer>> reaction = Maps.newHashMap();
View Full Code Here

TOP

Related Classes of org.jclouds.compute.domain.TemplateBuilder

Copyright © 2018 www.massapicom. 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.