Package org.jclouds.scriptbuilder.domain

Examples of org.jclouds.scriptbuilder.domain.Statement


    }
  }

  @Test(timeout = TestConstants.ITEST_TIMEOUT)
  public void testBinMahout() throws Exception {
    Statement binMahout = Statements.exec("source /etc/profile; $MAHOUT_HOME/bin/mahout");

    Cluster.Instance mahoutInstance = findMahoutInstance();
    Predicate<NodeMetadata> mahoutClientRole = and(alwaysTrue(), withIds(mahoutInstance.getId()));

    Map<? extends NodeMetadata, ExecResponse> responses = controller.runScriptOnNodesMatching(clusterSpec, mahoutClientRole, binMahout);
View Full Code Here


    }
  }

  @Test(timeout = TestConstants.ITEST_TIMEOUT)
  public void testPigBin() throws Exception {
    Statement binPig = Statements.exec(". /etc/profile && pig -e fs -ls /");

    Cluster.Instance pigInstance = findPigInstance();
    Predicate<NodeMetadata> pigClientRole = and(alwaysTrue(), withIds(pigInstance.getId()));

    Map<? extends NodeMetadata, ExecResponse> responses = controller.runScriptOnNodesMatching(clusterSpec, pigClientRole, binPig);
View Full Code Here

    controller.destroyCluster(clusterSpec);
  }

  @Test(timeout = TestConstants.ITEST_TIMEOUT)
  public void testVersion() throws Exception {
    Statement checkVersion = Statements.exec("cat /usr/lib/hadoop/cloudera/cdh_version.properties");
    Map<? extends NodeMetadata, ExecResponse> responses =
       controller.runScriptOnNodesMatching(clusterSpec, ALL, checkVersion);

    printResponses(checkVersion, responses);
    assertResponsesContain(responses, checkVersion, "cdh4");
View Full Code Here

  @Test(timeout = TestConstants.ITEST_TIMEOUT)
  public void testRecipesWereRanInServiceBootstrap() throws Exception {

    // and shoudl be installed by the main handlers
    Statement testAnt = Statements.exec("ant -version");

    Map<? extends NodeMetadata, ExecResponse> responses = controller
        .runScriptOnNodesMatching(clusterSpec, allNodes, testAnt);

    printResponses(testAnt, responses);

    assertResponsesContain(responses, testAnt, "Apache Ant");

    Statement testMaven = Statements.exec("mvn --version");

    responses = controller.runScriptOnNodesMatching(clusterSpec, allNodes,
        testMaven);

    printResponses(testMaven, responses);
View Full Code Here

    Map<? extends NodeMetadata, ExecResponse> responses = runRecipe(java);

    printResponses(java, responses);

    Statement stmt = Statements.exec("java -version");

    responses = controller
        .runScriptOnNodesMatching(clusterSpec, allNodes, stmt);

    assertResponsesContain(responses, stmt, "Runtime Environment");
View Full Code Here

   * {@link ClusterActionEvent}.
   */
  public static void addRunUrl(ClusterActionEvent event, String runUrl,
      String... args)
      throws IOException {
    Statement statement = new RunUrlStatement(
        event.getClusterSpec().getRunUrlBase(), runUrl, args);
    event.getStatementBuilder().addStatement(statement);
  }
View Full Code Here

        return null;
    }

    @Override
    public Statement getStatement() {
        Statement statement = null;
        ChefService chefService = getChefService();
        if (chefService != null) {
            List<String> runlist = new RunListBuilder().addRecipes(cookbook).build();
            chefService.updateRunListForGroup(runlist, "single");
            statement = chefService.createBootstrapScriptForGroup("single");
View Full Code Here

        return null;
    }

    @Override
    public Statement getStatement() {
        Statement statement = null;
        ChefService chefService = getChefService();
        if (chefService != null) {
            List<String> runlist = new RunListBuilder().addRecipes(cookbook).build();
            chefService.updateRunListForGroup(runlist, group);
            statement = chefService.createBootstrapScriptForGroup(group);
View Full Code Here

   * {@link ClusterActionEvent}.
   */
  public static void addRunUrl(ClusterActionEvent event, String runUrl,
      String... args)
      throws IOException {
    Statement statement = new RunUrlStatement(
        event.getClusterSpec().getRunUrlBase(), runUrl, args);
    addStatement(event, statement);
  }
View Full Code Here

      TemplateBuilderStrategy strategy)
      throws MalformedURLException {
    LOG.info("Configuring template");
    if (LOG.isDebugEnabled())
      LOG.debug("Running script:\n{}", statementBuilder.render(OsFamily.UNIX));
    Statement runScript = addUserAndAuthorizeSudo(
        clusterSpec.getClusterUser(),
        clusterSpec.getPublicKey(),
        clusterSpec.getPrivateKey(),
        statementBuilder);
    TemplateBuilder templateBuilder = computeService.templateBuilder()
View Full Code Here

TOP

Related Classes of org.jclouds.scriptbuilder.domain.Statement

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.