Package org.apache.whirr

Examples of org.apache.whirr.ClusterControllerFactory


    assertThat(predicate.getValue().toString(), is(expected.toString()));
  }

  @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


* A command to destroy a running cluster (terminate and cleanup).
*/
public class DestroyClusterCommand extends AbstractClusterSpecCommand {

  public DestroyClusterCommand() throws IOException {
    this(new ClusterControllerFactory());
  }
View Full Code Here

    .accepts("script", "Path to script file to execute.")
    .withRequiredArg()
    .ofType(String.class);

  public RunScriptCommand() {
    this(new ClusterControllerFactory());
  }
View Full Code Here

* A command to list the nodes in a cluster.
*/
public class ListClusterCommand extends AbstractClusterSpecCommand {

  public ListClusterCommand() throws IOException {
    this(new ClusterControllerFactory());
  }
View Full Code Here

* A command to launch a new cluster.
*/
public class LaunchClusterCommand extends AbstractClusterSpecCommand {

  public LaunchClusterCommand() throws IOException {
    this(new ClusterControllerFactory());
  }
View Full Code Here

      .accepts("instance-id", "Cluster instance ID")
      .withRequiredArg()
      .ofType(String.class);

  public DestroyInstanceCommand() throws IOException {
    this(new ClusterControllerFactory());
  }
View Full Code Here

        return siteXML;
    }

    private ClusterController createClusterController(String serviceName){
        ClusterControllerFactory factory = new ClusterControllerFactory();
        ClusterController controller = factory.create(serviceName);

        if(controller == null){
            logger.warn("Unable to find the service {0}, using default.", serviceName);
            controller = factory.create(null);
        }

        return controller;
    }
View Full Code Here

* A command to destroy a running cluster (terminate and cleanup).
*/
public class DestroyClusterCommand extends AbstractClusterCommand {

  public DestroyClusterCommand() throws IOException {
    this(new ClusterControllerFactory());
  }
View Full Code Here

  }

  @Test
  public void testAllOptions() throws Exception {

    ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
    ClusterController controller = mock(ClusterController.class);
    when(factory.create((String) any())).thenReturn(controller);

    NodeMetadata node1 = new NodeMetadataBuilder().name("name1").ids("id1")
        .location(new LocationBuilder().scope(LocationScope.PROVIDER)
          .id("location-id1").description("location-desc1").build())
        .imageId("image-id").state(NodeState.RUNNING)
View Full Code Here

      containsString("Please specify a script file to be executed."));
  }

  @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();

    int rc = command.run(null, out, System.err, Lists.newArrayList(
View Full Code Here

TOP

Related Classes of org.apache.whirr.ClusterControllerFactory

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.