Package org.apache.whirr

Examples of org.apache.whirr.ClusterController


 
  @Test
  public void testAllOptions() throws Exception {
   
    ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
    ClusterController controller = mock(ClusterController.class);
    Cluster cluster = mock(Cluster.class);
    when(factory.create((String) any())).thenReturn(controller);
    when(controller.launchCluster((ClusterSpec) any())).thenReturn(cluster);
   
    LaunchClusterCommand command = new LaunchClusterCommand(factory);
    Map<String, File> keys = KeyPair.generateTemporaryFiles();
   
    int rc = command.run(null, out, null, Lists.newArrayList(
View Full Code Here


 
  @Test
  public void testMaxPercentFailure() throws Exception {
   
    ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
    ClusterController controller = mock(ClusterController.class);
    Cluster cluster = mock(Cluster.class);
    when(factory.create((String) any())).thenReturn(controller);
    when(controller.launchCluster((ClusterSpec) any())).thenReturn(cluster);
   
    LaunchClusterCommand command = new LaunchClusterCommand(factory);
    Map<String, File> keys = KeyPair.generateTemporaryFiles();
   
    int rc = command.run(null, out, null, Lists.newArrayList(
View Full Code Here

      return this.clusterSpec = super.getClusterSpec(optionSet);
    }

    @Override
    protected ClusterController createClusterController(String serviceName) {
      ClusterController controller = super.createClusterController(serviceName);
      this.dryRun = controller.getCompute().apply(clusterSpec).utils().injector().getInstance(DryRun.class).reset();
      return controller;
    }
View Full Code Here

  }

  @Test
  public void testRunScriptByInstanceId() throws Exception {
    ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
    ClusterController controller = mock(ClusterController.class);

    when(factory.create((String)any())).thenReturn(controller);

    RunScriptCommand command = new RunScriptCommand(factory);
    Map<String, File> keys = KeyPair.generateTemporaryFiles();
View Full Code Here

  }

  @Test
  public void testRunScriptByRole() throws Exception {
    ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
    ClusterController controller = mock(ClusterController.class);
    when(factory.create((String)any())).thenReturn(controller);

    ClusterStateStore memStore = new MemoryClusterStateStore();
    memStore.save(createTestCluster(
      new String[]{"reg/A", "reg/B"}, new String[]{"A", "B"}));
View Full Code Here

    if (System.getProperty("config") != null) {
      config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration(getPropertiesFilename()));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
   
    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();
  }
View Full Code Here

    if (System.getProperty("config") != null) {
      config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration("whirr-zookeeper-cdh3-test.properties"));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
   
    cluster = controller.launchCluster(clusterSpec);
    hosts = ZooKeeperCluster.getHosts(cluster);
  }
View Full Code Here

    if (System.getProperty("config") != null) {
      config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration(HamaServiceController.class.getResource("/whirr-hama-test.properties")));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
   
    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();
View Full Code Here

  /**
   * Create the specified service
   */
  protected ClusterController createClusterController(String serviceName) {
    ClusterController controller = factory.create(serviceName);
    if (controller == null) {
      LOG.warn("Unable to find service {}, using default.", serviceName);
      controller = factory.create(null);
    }
    return controller;
View Full Code Here

      config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration("whirr-puppet-test.properties"));

    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
    cluster = controller.launchCluster(clusterSpec);
    socketTester = new RetryablePredicate<HostAndPort>(new InetSocketAddressConnect(), 60, 1, TimeUnit.SECONDS);

  }
View Full Code Here

TOP

Related Classes of org.apache.whirr.ClusterController

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.