Package org.apache.whirr

Examples of org.apache.whirr.ClusterController


    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(getPropertiesFilename()));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();
   
    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
    proxy.start();
  }
View Full Code Here

    config.setProperty("whirr.cluster-name", "stub-test");
    config.setProperty("whirr.instance-templates", "1 noop");
    config.setProperty("whirr.state-store", "memory");

    ClusterSpec clusterSpec = ClusterSpec.withTemporaryKeys(config);
    ClusterController controller = new ClusterController();

    DryRun dryRun = getDryRunInControllerForCluster(controller, clusterSpec);
    dryRun.reset();
   
    controller.launchCluster(clusterSpec);
    controller.destroyCluster(clusterSpec);

    ListMultimap<NodeMetadata, Statement> perNodeExecutions = dryRun.getExecutions();

    for (Entry<NodeMetadata, Collection<Statement>> entry : perNodeExecutions
        .asMap().entrySet()) {
View Full Code Here

    config.setProperty("whirr.cluster-name", "stub-test");
    config.setProperty("whirr.instance-templates", "10 noop+noop3,10 noop2+noop,10 noop3+noop2");
    config.setProperty("whirr.state-store", "memory");

    ClusterSpec clusterSpec = ClusterSpec.withTemporaryKeys(config);
    ClusterController controller = new ClusterController();
   
    DryRun dryRun = getDryRunInControllerForCluster(controller, clusterSpec);
    dryRun.reset();
   
    controller.launchCluster(clusterSpec);
    controller.destroyCluster(clusterSpec);

   
    ListMultimap<NodeMetadata, Statement> perNodeExecutions = dryRun.getExecutions();
    List<StatementOnNode> totalExecutions = dryRun.getTotallyOrderedExecutions();
View Full Code Here

        newInstanceTemplate("noop"),
        newInstanceTemplate("noop", "noop1", "noop2"),
        newInstanceTemplate("noop1", "noop3")
    ));

    ClusterController controller = new ClusterController();
    cluster = controller.launchCluster(clusterSpec);
  }
View Full Code Here

    if (System.getProperty("config") != null) {
      config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration("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

    };
  }

  protected DryRun launchWithClusterSpec(ClusterSpec clusterSpec) throws IOException, InterruptedException {
    ClusterController controller = new ClusterController();
    DryRun dryRun = controller.getCompute().apply(clusterSpec).utils().injector().getInstance(DryRun.class);
    dryRun.reset();
    controller.launchCluster(clusterSpec);
    return dryRun;
  }
View Full Code Here

  }

  @Test(timeout = TestConstants.ITEST_TIMEOUT)
  public void testNoRemoteExecutionOverlap() throws Exception {
    ClusterSpec spec = getTestClusterSpec();
    ClusterController controller =
      (new ClusterControllerFactory()).create(spec.getServiceName());

    try {
      controller.launchCluster(spec);
      Map<? extends NodeMetadata, ExecResponse> responseMap = controller.runScriptOnNodesMatching(
        spec,
        Predicates.<NodeMetadata>alwaysTrue(),
        exec("cat /tmp/bootstrap-start /tmp/bootstrap-end /tmp/configure-start")
      );
      ExecResponse response = Iterables.get(responseMap.values(), 0);
      LOG.info("Got response: {}", response);

      String[] parts = Strings.split(response.getOutput(), '\n');

      int bootstrapStart = parseInt(deleteWhitespace(parts[0]));
      int bootstrapEnd = parseInt(deleteWhitespace(parts[1]));
      int configureStart = parseInt(deleteWhitespace(parts[2]));

      assertTrue(bootstrapStart < bootstrapEnd);
      assertTrue(bootstrapEnd < configureStart);

    } finally {
      controller.destroyCluster(spec);
    }

    assertNoOverlapOnLocalMachine();
  }
View Full Code Here

    }
  }

  public int run(InputStream in, PrintStream out, PrintStream err,
                 ClusterSpec clusterSpec) throws Exception {
    ClusterController controller = createClusterController(clusterSpec.getServiceName());
    controller.destroyCluster(clusterSpec);
    return 0;
  }
View Full Code Here

  }

  public int run(InputStream in, PrintStream out, PrintStream err,
                 ClusterSpec clusterSpec, String[] instances, String[] roles,
                 String fileName) throws Exception {
    ClusterController controller = createClusterController(clusterSpec.getServiceName());
    Predicate<NodeMetadata> condition = buildFilterPredicate(instances, roles, clusterSpec);

    return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
      clusterSpec, condition, execFile(fileName)));
  }
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.