org.apache.whirr
Class ByonClusterController

java.lang.Object
  extended by org.apache.whirr.ClusterController
      extended by org.apache.whirr.ByonClusterController

public class ByonClusterController
extends ClusterController

Equivalent of ClusterController, but for execution in BYON mode ("bring your own nodes").


Field Summary
 
Fields inherited from class org.apache.whirr.ClusterController
handlerMapFactory
 
Constructor Summary
ByonClusterController()
           
ByonClusterController(com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> getCompute, ClusterStateStoreFactory stateStoreFactory)
           
 
Method Summary
 Cluster bootstrapCluster(ClusterSpec clusterSpec)
          Provisions the hardware for a BYON cluster.
 Cluster configureServices(ClusterSpec clusterSpec, Cluster cluster, Set<String> targetRoles, Set<String> targetInstanceIds)
          Configures cluster services for a BYON cluster.
 void destroyCluster(ClusterSpec clusterSpec)
          Destroys a whirr BYON cluster.
 void destroyInstance(ClusterSpec clusterSpec, String instanceId)
           
 String getName()
           
 Set<? extends org.jclouds.compute.domain.NodeMetadata> getNodes(ClusterSpec clusterSpec)
           
 Map<? extends org.jclouds.compute.domain.NodeMetadata,org.jclouds.compute.domain.ExecResponse> runScriptOnNodesMatching(ClusterSpec spec, com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> condition, org.jclouds.scriptbuilder.domain.Statement statement)
           
 
Methods inherited from class org.apache.whirr.ClusterController
cleanupCluster, cleanupCluster, configureServices, configureServices, defaultRunScriptOptionsForSpec, destroyCluster, getClusterStateStore, getCompute, getHandlerMapFactory, getInstances, getInstances, launchCluster, runningInGroup, runScriptOnNodesMatching, setHandlerMapFactory, startServices, startServices, startServices, stopServices, stopServices, stopServices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByonClusterController

public ByonClusterController()

ByonClusterController

public ByonClusterController(com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> getCompute,
                             ClusterStateStoreFactory stateStoreFactory)
Method Detail

getName

public String getName()
Overrides:
getName in class ClusterController
Returns:
the unique name of the service.

destroyCluster

public void destroyCluster(ClusterSpec clusterSpec)
                    throws IOException,
                           InterruptedException
Destroys a whirr BYON cluster. Because this is a BYON cluster it also stops the services.

Overrides:
destroyCluster in class ClusterController
Throws:
IOException - if there is a problem while stopping the cluster. The cluster may or may not have been stopped.
InterruptedException - if the thread is interrupted.

bootstrapCluster

public Cluster bootstrapCluster(ClusterSpec clusterSpec)
                         throws IOException,
                                InterruptedException
Provisions the hardware for a BYON cluster.

Overrides:
bootstrapCluster in class ClusterController
Throws:
IOException
InterruptedException

configureServices

public Cluster configureServices(ClusterSpec clusterSpec,
                                 Cluster cluster,
                                 Set<String> targetRoles,
                                 Set<String> targetInstanceIds)
                          throws IOException,
                                 InterruptedException
Configures cluster services for a BYON cluster.

Overrides:
configureServices in class ClusterController
Throws:
IOException
InterruptedException

runScriptOnNodesMatching

public Map<? extends org.jclouds.compute.domain.NodeMetadata,org.jclouds.compute.domain.ExecResponse> runScriptOnNodesMatching(ClusterSpec spec,
                                                                                                                               com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> condition,
                                                                                                                               org.jclouds.scriptbuilder.domain.Statement statement)
                                                                                                                        throws IOException,
                                                                                                                               org.jclouds.compute.RunScriptOnNodesException
Overrides:
runScriptOnNodesMatching in class ClusterController
Throws:
IOException
org.jclouds.compute.RunScriptOnNodesException

destroyInstance

public void destroyInstance(ClusterSpec clusterSpec,
                            String instanceId)
                     throws IOException
Overrides:
destroyInstance in class ClusterController
Throws:
IOException

getNodes

public Set<? extends org.jclouds.compute.domain.NodeMetadata> getNodes(ClusterSpec clusterSpec)
                                                                throws IOException,
                                                                       InterruptedException
Overrides:
getNodes in class ClusterController
Throws:
IOException
InterruptedException


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.