Package org.apache.whirr.service

Examples of org.apache.whirr.service.ClusterSpec$InstanceTemplate


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

        clusterSpec = new ClusterSpec(config);
        if (clusterSpec.getPrivateKey() == null)
        {
            Map<String, String> pair = KeyPair.generate();
            clusterSpec.setPublicKey(pair.get("public"));
            clusterSpec.setPrivateKey(pair.get("private"));
View Full Code Here


    };

    OptionSet optionSet = clusterSpecCommand.parser.parse(
        "--service-name", "overridden-test-service",
        "--config", "whirr-override-test.properties");
    ClusterSpec clusterSpec = clusterSpecCommand.getClusterSpec(optionSet);
    assertThat(clusterSpec.getServiceName(), is("overridden-test-service"));
    assertThat(clusterSpec.getClusterName(), is("test-cluster"));
  }
View Full Code Here

    };

    OptionSet optionSet = clusterSpecCommand.parser.parse(
        "--service-name", "foo",
        "--config", "whirr-override-test.properties");
    ClusterSpec clusterSpec = clusterSpecCommand.getClusterSpec(optionSet);
    // this should fail - non-existent service
    clusterSpecCommand.createService("bar");
  }
View Full Code Here

      if (config.getString(required.getConfigName()) == null) {
        throw new IllegalArgumentException(String.format("Option '%s' not set.",
            required.getSimpleName()));
      }
    }
    return new ClusterSpec(config);
  }
View Full Code Here

    if (!optionSet.nonOptionArguments().isEmpty()) {
      printUsage(parser, err);
      return -1;
    }
    try {
      ClusterSpec clusterSpec = getClusterSpec(optionSet);

      Service service = factory.create(clusterSpec.getServiceName());
      Set<? extends NodeMetadata> nodes = service.getNodes(clusterSpec);
      for (NodeMetadata node : nodes) {
        out.println(Joiner.on('\t').join(node.getId(), node.getImageId(),
            getFirstAddress(node.getPublicAddresses()),
            getFirstAddress(node.getPrivateAddresses()),
View Full Code Here

        "--public-key-file", publicKeyFile.getAbsolutePath()
        ));
   
    assertThat(rc, is(0));

    ClusterSpec expectedClusterSpec = new ClusterSpec();
    expectedClusterSpec.setServiceName("test-service");
    expectedClusterSpec.setProvider("rackspace");
    expectedClusterSpec.setIdentity("myusername");
    expectedClusterSpec.setCredential("mypassword");
    expectedClusterSpec.setClusterName("test-cluster");
    expectedClusterSpec.setPrivateKey(privateKeyFile);
    expectedClusterSpec.setPublicKey(publicKeyFile);
   
    verify(factory).create("test-service");
   
    verify(service).destroyCluster(expectedClusterSpec);
   
View Full Code Here

    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
      config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration("whirr-zookeeper-test.properties"));
    clusterSpec = new ClusterSpec(config);
    if (clusterSpec.getPrivateKey() == null) {
      Map<String, String> pair = KeyPair.generate();
      clusterSpec.setPublicKey(pair.get("public"));
      clusterSpec.setPrivateKey(pair.get("private"));
    }
View Full Code Here

        "--public-key-file", publicKeyFile.getAbsolutePath()
        ));
   
    assertThat(rc, is(0));

    ClusterSpec expectedClusterSpec = new ClusterSpec();
    expectedClusterSpec.setInstanceTemplates(Lists.newArrayList(
        new ClusterSpec.InstanceTemplate(1, Sets.newHashSet("role1", "role2")),
        new ClusterSpec.InstanceTemplate(2, Sets.newHashSet("role3"))
    ));
    expectedClusterSpec.setServiceName("test-service");
    expectedClusterSpec.setProvider("rackspace");
    expectedClusterSpec.setIdentity("myusername");
    expectedClusterSpec.setCredential("mypassword");
    expectedClusterSpec.setClusterName("test-cluster");
    expectedClusterSpec.setPrivateKey(privateKeyFile);
    expectedClusterSpec.setPublicKey(publicKeyFile);
   
    verify(factory).create("test-service");
   
    verify(service).launchCluster(expectedClusterSpec);
   
View Full Code Here

    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
      config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration("whirr-cassandra-test.properties"));
    clusterSpec = new ClusterSpec(config);
    if (clusterSpec.getPrivateKey() == null) {
      Map<String, String> pair = KeyPair.generate();
      clusterSpec.setPublicKey(pair.get("public"));
      clusterSpec.setPrivateKey(pair.get("private"));
    }
View Full Code Here

    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
      config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration("whirr-hadoop-test.properties"));
    clusterSpec = new ClusterSpec(config);
    if (clusterSpec.getPrivateKey() == null) {
      Map<String, String> pair = KeyPair.generate();
      clusterSpec.setPublicKey(pair.get("public"));
      clusterSpec.setPrivateKey(pair.get("private"));
    }
View Full Code Here

TOP

Related Classes of org.apache.whirr.service.ClusterSpec$InstanceTemplate

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.