Package org.apache.whirr

Examples of org.apache.whirr.ClusterSpec


    return getConfigureFunction(config, "hadoop", "configure_hadoop");
  }
 
  @Override
  protected void beforeBootstrap(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Configuration conf = getConfiguration(clusterSpec);

    addStatement(event, call("retry_helpers"));
    addStatement(event, call("configure_hostnames"));
    addStatement(event, call("install_tarball"));
View Full Code Here


  }
   
  @Override
  protected void beforeConfigure(ClusterActionEvent event)
      throws IOException, InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();
   
    doBeforeConfigure(event);

    createHadoopConfigFiles(event, clusterSpec, cluster);

    addStatement(event, call("retry_helpers"));
    addStatement(event, call(
      getConfigureFunction(getConfiguration(clusterSpec)),
      Joiner.on(",").join(event.getInstanceTemplate().getRoles()),
      "-c", clusterSpec.getProvider())
    );
  }
View Full Code Here

  @Override
  protected Object doExecute() throws Exception {
    validateInput();
    LaunchClusterCommand command = new LaunchClusterCommand(clusterControllerFactory);
    ClusterSpec clusterSpec = getClusterSpec();
    if (clusterSpec != null) {
      command.run(System.in, System.out, System.err, clusterSpec);
    }
    return null;
  }
View Full Code Here

   *
   * @return
   * @throws Exception
   */
  protected ClusterSpec getClusterSpec() throws Exception {
    ClusterSpec clusterSpec = null;
    if (pid != null || fileName != null) {
      PropertiesConfiguration properties = getConfiguration(pid, fileName);
      clusterSpec = new ClusterSpec(properties);
    } else {
      clusterSpec = new ClusterSpec();
    }



    if (provider != null) {
      clusterSpec.setProvider(provider);
    }

    if (endpoint != null) {
      clusterSpec.setEndpoint(endpoint);
    }

    if (templates != null) {
      clusterSpec.setInstanceTemplates(getTemplate(templates, imageId, hardwareId));
    }


    if (privateKey != null) {
      clusterSpec.setPrivateKey(privateKey);
    }
    if (clusterName != null) {
      clusterSpec.setClusterName(clusterName);
    }

    return clusterSpec;
  }
View Full Code Here

    conf.addProperty("whirr.instance-templates",
      "1 hadoop-namenode+hadoop-jobtracker,4 hadoop-datanode+hadoop-tasktracker");
    conf.addProperty("whirr.instance-templates-max-percent-failures", "60 hadoop-datanode+hadoop-tasktracker");
    conf.addProperty("whirr.provider", "ec2");
    config.addConfiguration(conf);
    ClusterSpec clusterSpec = ClusterSpec.withTemporaryKeys(conf);

    Set<String> jtnn = new HashSet<String>();
    jtnn.add("hadoop-jobtracker");
    jtnn.add("hadoop-namenode");    
    Set<String> dntt = new HashSet<String>();
View Full Code Here

    conf.addProperty("whirr.instance-templates",
      "1 hadoop-namenode+hadoop-jobtracker,4 hadoop-datanode+hadoop-tasktracker");
    conf.addProperty("whirr.instance-templates-max-percent-failures", "60 hadoop-datanode+hadoop-tasktracker");
    conf.addProperty("whirr.provider", "ec2");
    config.addConfiguration(conf);
    ClusterSpec clusterSpec = ClusterSpec.withTemporaryKeys(conf);

    Set<String> jtnn = new HashSet<String>();
    jtnn.add("hadoop-jobtracker");
    jtnn.add("hadoop-namenode");    
    Set<String> dntt = new HashSet<String>();
View Full Code Here

    conf.addProperty("whirr.service-name", "test-service");
    conf.addProperty("whirr.cluster-name", "test-cluster");
    conf.addProperty("whirr.instance-templates", "1 puppet:module::manifest+something-else");
    conf.addProperty("whirr.provider", "ec2");
    config.addConfiguration(conf);
    ClusterSpec clusterSpec = ClusterSpec.withTemporaryKeys(conf);

    Set<String> nn = new HashSet<String>();
    nn.add("puppet:module::manifest");
    nn.add("something-else");    
View Full Code Here

    conf.addProperty("whirr.service-name", "test-service");
    conf.addProperty("whirr.cluster-name", "test-cluster");
    conf.addProperty("whirr.instance-templates", "1 puppet:module::manifest+something-else");
    conf.addProperty("whirr.provider", "ec2");
    config.addConfiguration(conf);
    ClusterSpec clusterSpec = ClusterSpec.withTemporaryKeys(conf);

    Set<String> nn = new HashSet<String>();
    nn.add("puppet:module::manifest");
    nn.add("something-else");    
View Full Code Here

  }

  @Override
  protected void beforeConfigure(ClusterActionEvent event) throws IOException,
      InterruptedException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    LOG.info("Authorizing firewall");
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();
View Full Code Here

        HamaConstants.PARAM_TARBALL_URL, tarurl));
  }

  @Override
  protected void afterConfigure(ClusterActionEvent event) throws IOException {
    ClusterSpec clusterSpec = event.getClusterSpec();
    Cluster cluster = event.getCluster();

    LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
    Instance instance = cluster.getInstanceMatching(role(ROLE));
    InetAddress masterPublicAddress = instance.getPublicAddress();

    LOG.info("BSPMaster web UI available at http://{}:{}",
        masterPublicAddress.getHostName(), MASTER_WEB_UI_PORT);
View Full Code Here

TOP

Related Classes of org.apache.whirr.ClusterSpec

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.