public abstract class ScriptBasedClusterAction extends ClusterAction
ClusterAction that provides the base functionality for running
scripts on instances in the cluster.| Modifier | Constructor and Description |
|---|---|
protected |
ScriptBasedClusterAction(com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> getCompute,
com.google.common.cache.LoadingCache<String,ClusterActionHandler> handlerMap) |
protected |
ScriptBasedClusterAction(com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> getCompute,
com.google.common.cache.LoadingCache<String,ClusterActionHandler> handlerMap,
Set<String> targetRoles,
Set<String> targetInstanceIds) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doAction(Map<InstanceTemplate,ClusterActionEvent> eventMap) |
protected void |
eventSpecificActions(InstanceTemplate instanceTemplate,
ClusterActionEvent event) |
Cluster |
execute(ClusterSpec clusterSpec,
Cluster cluster) |
protected com.google.common.base.Predicate<Cluster.Instance> |
instanceIsNotInTarget() |
protected void |
postRunScriptsActions(Map<InstanceTemplate,ClusterActionEvent> eventMap) |
protected boolean |
roleIsInTarget(String role) |
protected void |
runScripts(Map<InstanceTemplate,ClusterActionEvent> eventMap) |
com.google.common.util.concurrent.ListenableFuture<org.jclouds.compute.domain.ExecResponse> |
runStatementOnInstanceInCluster(StatementBuilder statementBuilder,
Cluster.Instance instance,
ClusterSpec clusterSpec,
org.jclouds.compute.options.RunScriptOptions options) |
protected boolean |
shouldIgnoreInstanceTemplate(InstanceTemplate template) |
getAction, getComputeprotected ScriptBasedClusterAction(com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> getCompute, com.google.common.cache.LoadingCache<String,ClusterActionHandler> handlerMap)
protected ScriptBasedClusterAction(com.google.common.base.Function<ClusterSpec,org.jclouds.compute.ComputeServiceContext> getCompute, com.google.common.cache.LoadingCache<String,ClusterActionHandler> handlerMap, Set<String> targetRoles, Set<String> targetInstanceIds)
public Cluster execute(ClusterSpec clusterSpec, Cluster cluster) throws IOException, InterruptedException
execute in class ClusterActionIOExceptionInterruptedExceptionprotected void doAction(Map<InstanceTemplate,ClusterActionEvent> eventMap) throws InterruptedException, IOException
InterruptedExceptionIOExceptionprotected void runScripts(Map<InstanceTemplate,ClusterActionEvent> eventMap) throws InterruptedException, IOException
InterruptedExceptionIOExceptionpublic com.google.common.util.concurrent.ListenableFuture<org.jclouds.compute.domain.ExecResponse> runStatementOnInstanceInCluster(StatementBuilder statementBuilder, Cluster.Instance instance, ClusterSpec clusterSpec, org.jclouds.compute.options.RunScriptOptions options)
protected boolean shouldIgnoreInstanceTemplate(InstanceTemplate template)
protected boolean roleIsInTarget(String role)
protected com.google.common.base.Predicate<Cluster.Instance> instanceIsNotInTarget()
protected void eventSpecificActions(InstanceTemplate instanceTemplate, ClusterActionEvent event) throws IOException
IOExceptionprotected void postRunScriptsActions(Map<InstanceTemplate,ClusterActionEvent> eventMap) throws IOException
IOExceptionCopyright © 2010–2016 Cloudera. All rights reserved.