Package org.jclouds.compute

Examples of org.jclouds.compute.ComputeServiceContextFactory


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

    ComputeServiceContextFactory serviceContextFactory = mock(ComputeServiceContextFactory.class);
    ComputeServiceContext serviceContext = mock(ComputeServiceContext.class);
    ComputeService computeService = mock(ComputeService.class);
    TemplateBuilder templateBuilder = mock(TemplateBuilder.class);
    Template template = mock(Template.class);

    when(serviceContextFactory.createContext((String) any(), (String) any(), (String) any()
        (Iterable<? extends Module>) any(), (Properties) any())).thenReturn(serviceContext);
    when(serviceContext.getComputeService()).thenReturn(computeService);
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
View Full Code Here


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

    ComputeServiceContextFactory serviceContextFactory = mock(ComputeServiceContextFactory.class);
    ComputeServiceContext serviceContext = mock(ComputeServiceContext.class);
    ComputeService computeService = mock(ComputeService.class);
    TemplateBuilder templateBuilder = mock(TemplateBuilder.class);
    Template template = mock(Template.class);

    when(serviceContextFactory.createContext((String) any(), (String) any(), (String) any()
        (Iterable<? extends Module>) any(), (Properties) any())).thenReturn(serviceContext);
    when(serviceContext.getComputeService()).thenReturn(computeService);
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
View Full Code Here

public class ComputeServiceContextBuilder {
  private static final Logger LOG =
    LoggerFactory.getLogger(ComputeServiceContextBuilder.class);
  
  public static ComputeServiceContext build(final ClusterSpec spec) throws IOException {
    return build(new ComputeServiceContextFactory(), spec);
  }
View Full Code Here

   * @throws InterruptedException if the thread is interrupted.
   */
  public Cluster launchCluster(ClusterSpec clusterSpec)
      throws IOException, InterruptedException {
   
    ComputeServiceContextFactory computeServiceFactory = new ComputeServiceContextFactory();
    Map<String, ClusterActionHandler> handlerMap = new HandlerMapFactory().create();

    BootstrapClusterAction bootstrapper = new BootstrapClusterAction(computeServiceFactory, handlerMap);
    Cluster cluster = bootstrapper.execute(clusterSpec, null);

View Full Code Here

   * cluster may or may not have been stopped.
   * @throws InterruptedException if the thread is interrupted.
   */
  public void destroyCluster(ClusterSpec clusterSpec) throws IOException,
      InterruptedException {
    DestroyClusterAction destroyer = new DestroyClusterAction(new ComputeServiceContextFactory());
    destroyer.execute(clusterSpec, null);
    Files.deleteRecursively(clusterSpec.getClusterDirectory());
  }
View Full Code Here

  }
 
  public Set<? extends NodeMetadata> getNodes(ClusterSpec clusterSpec)
    throws IOException, InterruptedException {
    ComputeService computeService =
      ComputeServiceContextBuilder.build(new ComputeServiceContextFactory(), clusterSpec).getComputeService();
    return computeService.listNodesDetailsMatching(
        runningInGroup(clusterSpec.getClusterName()));
  }
View Full Code Here

      String secretkey = args[1];
      String group = args[2];
      String command = args[3];

      // Init
      ComputeService compute = new ComputeServiceContextFactory().createContext("aws-ec2", accesskeyid, secretkey)
               .getComputeService();

      // wait up to 60 seconds for ssh to be accessible
      RetryablePredicate<IPSocket> socketTester = new RetryablePredicate<IPSocket>(new InetSocketAddressConnect(), 60,
               1, 1, TimeUnit.SECONDS);
View Full Code Here

TOP

Related Classes of org.jclouds.compute.ComputeServiceContextFactory

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.