public class ClusterController extends Object
| Modifier and Type | Field and Description |
|---|---|
protected HandlerMapFactory |
handlerMapFactory |
| Constructor and Description |
|---|
ClusterController() |
ClusterController(com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> getCompute,
ClusterStateStoreFactory stateStoreFactory) |
| Modifier and Type | Method and Description |
|---|---|
Cluster |
bootstrapCluster(ClusterSpec clusterSpec)
Provision the hardware resources needed for running services
|
Cluster |
cleanupCluster(ClusterSpec spec)
Remove the cluster services
|
Cluster |
cleanupCluster(ClusterSpec clusterSpec,
Cluster cluster) |
Cluster |
configureServices(ClusterSpec spec)
Configure cluster services
|
Cluster |
configureServices(ClusterSpec clusterSpec,
Cluster cluster) |
Cluster |
configureServices(ClusterSpec clusterSpec,
Cluster cluster,
Set<String> targetRoles,
Set<String> targetInstanceIds) |
org.jclouds.compute.options.RunScriptOptions |
defaultRunScriptOptionsForSpec(ClusterSpec spec) |
void |
destroyCluster(ClusterSpec clusterSpec)
Stop the cluster and destroy all resources associated with it.
|
void |
destroyCluster(ClusterSpec clusterSpec,
Cluster cluster) |
void |
destroyInstance(ClusterSpec clusterSpec,
String instanceId) |
ClusterStateStore |
getClusterStateStore(ClusterSpec clusterSpec) |
com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> |
getCompute() |
HandlerMapFactory |
getHandlerMapFactory() |
Set<Cluster.Instance> |
getInstances(ClusterSpec spec) |
Set<Cluster.Instance> |
getInstances(ClusterSpec spec,
ClusterStateStore stateStore) |
String |
getName() |
Set<? extends org.jclouds.compute.domain.NodeMetadata> |
getNodes(ClusterSpec clusterSpec)
Deprecated.
|
Cluster |
launchCluster(ClusterSpec clusterSpec)
Start the cluster described by
clusterSpec and block until the
cluster is
available. |
static com.google.common.base.Predicate<org.jclouds.compute.domain.ComputeMetadata> |
runningInGroup(String group) |
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) |
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,
org.jclouds.compute.options.RunScriptOptions options) |
void |
setHandlerMapFactory(HandlerMapFactory handlerMapFactory) |
Cluster |
startServices(ClusterSpec spec)
Start the cluster services
|
Cluster |
startServices(ClusterSpec clusterSpec,
Cluster cluster) |
Cluster |
startServices(ClusterSpec clusterSpec,
Cluster cluster,
Set<String> targetRoles,
Set<String> targetInstanceIds) |
Cluster |
stopServices(ClusterSpec spec)
Stop the cluster services
|
Cluster |
stopServices(ClusterSpec clusterSpec,
Cluster cluster) |
Cluster |
stopServices(ClusterSpec clusterSpec,
Cluster cluster,
Set<String> targetRoles,
Set<String> targetInstanceIds) |
protected HandlerMapFactory handlerMapFactory
public ClusterController()
public ClusterController(com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> getCompute, ClusterStateStoreFactory stateStoreFactory)
public String getName()
public com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> getCompute()
public Cluster launchCluster(ClusterSpec clusterSpec) throws IOException, InterruptedException
clusterSpec and block until the
cluster is
available. It is not guaranteed that the service running on the cluster
has started when this method returns.clusterSpec - IOException - if there is a problem while starting the cluster. The
cluster may or may not have started.InterruptedException - if the thread is interrupted.public Cluster bootstrapCluster(ClusterSpec clusterSpec) throws IOException, InterruptedException
IOExceptionInterruptedException@Beta public Cluster configureServices(ClusterSpec spec) throws IOException, InterruptedException
IOExceptionInterruptedException@Beta public Cluster configureServices(ClusterSpec clusterSpec, Cluster cluster) throws IOException, InterruptedException
IOExceptionInterruptedException@Beta public Cluster configureServices(ClusterSpec clusterSpec, Cluster cluster, Set<String> targetRoles, Set<String> targetInstanceIds) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Cluster startServices(ClusterSpec spec) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Cluster startServices(ClusterSpec clusterSpec, Cluster cluster) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Cluster startServices(ClusterSpec clusterSpec, Cluster cluster, Set<String> targetRoles, Set<String> targetInstanceIds) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Cluster stopServices(ClusterSpec spec) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Cluster stopServices(ClusterSpec clusterSpec, Cluster cluster) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Cluster stopServices(ClusterSpec clusterSpec, Cluster cluster, Set<String> targetRoles, Set<String> targetInstanceIds) throws IOException, InterruptedException
IOExceptionInterruptedException@Beta public Cluster cleanupCluster(ClusterSpec spec) throws IOException, InterruptedException
IOExceptionInterruptedException@Beta public Cluster cleanupCluster(ClusterSpec clusterSpec, Cluster cluster) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void destroyCluster(ClusterSpec clusterSpec) throws IOException, InterruptedException
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.public void destroyCluster(ClusterSpec clusterSpec, Cluster cluster) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void destroyInstance(ClusterSpec clusterSpec, String instanceId) throws IOException
IOExceptionpublic ClusterStateStore getClusterStateStore(ClusterSpec clusterSpec)
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
IOExceptionorg.jclouds.compute.RunScriptOnNodesExceptionpublic 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, org.jclouds.compute.options.RunScriptOptions options) throws IOException, org.jclouds.compute.RunScriptOnNodesException
IOExceptionorg.jclouds.compute.RunScriptOnNodesExceptionpublic org.jclouds.compute.options.RunScriptOptions defaultRunScriptOptionsForSpec(ClusterSpec spec)
@Deprecated public Set<? extends org.jclouds.compute.domain.NodeMetadata> getNodes(ClusterSpec clusterSpec) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Set<Cluster.Instance> getInstances(ClusterSpec spec) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Set<Cluster.Instance> getInstances(ClusterSpec spec, ClusterStateStore stateStore) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic HandlerMapFactory getHandlerMapFactory()
public void setHandlerMapFactory(HandlerMapFactory handlerMapFactory)
public static com.google.common.base.Predicate<org.jclouds.compute.domain.ComputeMetadata> runningInGroup(String group)
Copyright © 2010–2016 Cloudera. All rights reserved.