public abstract class ClusterActionHandlerSupport extends Object implements ClusterActionHandler
ClusterActionHandler. For each 'before' and 'after' action type there
is a corresponding method that implementations may override.BOOTSTRAP_ACTION, CLEANUP_ACTION, CONFIGURE_ACTION, DESTROY_ACTION, START_ACTION, STOP_ACTION| Constructor and Description |
|---|
ClusterActionHandlerSupport() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addClusterToEtcHostsAndFirewall(ClusterActionEvent event) |
static void |
addRunUrl(ClusterActionEvent event,
String runUrl,
String... args)
A convenience method for adding a
RunUrlStatement to a
ClusterActionEvent. |
static void |
addStatement(ClusterActionEvent event,
org.jclouds.scriptbuilder.domain.Statement statement) |
void |
afterAction(ClusterActionEvent event)
Called after the action has been performed.
|
protected void |
afterBootstrap(ClusterActionEvent event) |
protected void |
afterCleanup(ClusterActionEvent event) |
protected void |
afterConfigure(ClusterActionEvent event) |
protected void |
afterDestroy(ClusterActionEvent event) |
protected void |
afterOtherAction(ClusterActionEvent event) |
protected void |
afterStart(ClusterActionEvent event) |
protected void |
afterStop(ClusterActionEvent event) |
void |
beforeAction(ClusterActionEvent event)
Called before the action is performed, giving the implementation an
opportunity to specify scripts that should be run as a part of this
action.
|
protected void |
beforeBootstrap(ClusterActionEvent event) |
protected void |
beforeCleanup(ClusterActionEvent event) |
protected void |
beforeConfigure(ClusterActionEvent event) |
protected void |
beforeDestroy(ClusterActionEvent event) |
protected void |
beforeOtherAction(ClusterActionEvent event) |
protected void |
beforeStart(ClusterActionEvent event) |
protected void |
beforeStop(ClusterActionEvent event) |
boolean |
equals(Object that) |
String |
getCleanupFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service cleanup function name from the configuration
|
protected org.apache.commons.configuration.Configuration |
getConfiguration(ClusterSpec clusterSpec,
org.apache.commons.configuration.Configuration defaults)
Returns a composite configuration that is made up from the global
configuration coming from the Whirr core with the service default
properties.
|
protected org.apache.commons.configuration.Configuration |
getConfiguration(ClusterSpec clusterSpec,
String defaultsPropertiesFile) |
String |
getConfigureFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service configure function name from the configuration
|
String |
getFunctionName(org.apache.commons.configuration.Configuration config,
String service,
String functionName,
String defaultFunction) |
String |
getInstallFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service install function name from the configuration
|
String |
getStartFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service start function name from the configuration
|
String |
getStopFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service start function name from the configuration
|
static void |
handleFirewallRules(ClusterActionEvent event)
Handles firewall rules for a given event.
|
int |
hashCode()
this uses the inefficient
Objects implementation as the object count will be
relatively small and therefore efficiency is not a concern. |
static String |
prepareRemoteFileUrl(ClusterActionEvent event,
String rawUrl)
Prepare the file url for the remote machine.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetRolepublic void beforeAction(ClusterActionEvent event) throws IOException, InterruptedException
ClusterActionHandlerbeforeAction in interface ClusterActionHandlerIOExceptionInterruptedExceptionpublic void afterAction(ClusterActionEvent event) throws IOException, InterruptedException
ClusterActionHandlerafterAction in interface ClusterActionHandlerIOExceptionInterruptedExceptionprotected void beforeBootstrap(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void beforeConfigure(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void beforeStart(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void beforeStop(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void beforeCleanup(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void beforeDestroy(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void beforeOtherAction(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void afterBootstrap(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void afterConfigure(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void afterStart(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void afterStop(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void afterCleanup(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void afterDestroy(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void afterOtherAction(ClusterActionEvent event) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected org.apache.commons.configuration.Configuration getConfiguration(ClusterSpec clusterSpec, org.apache.commons.configuration.Configuration defaults)
clusterSpec - The cluster specification instance.protected org.apache.commons.configuration.Configuration getConfiguration(ClusterSpec clusterSpec, String defaultsPropertiesFile) throws IOException
IOExceptionpublic static void addRunUrl(ClusterActionEvent event, String runUrl, String... args) throws IOException
RunUrlStatement to a
ClusterActionEvent.IOExceptionpublic static void addStatement(ClusterActionEvent event, org.jclouds.scriptbuilder.domain.Statement statement)
public static void addClusterToEtcHostsAndFirewall(ClusterActionEvent event) throws IOException
IOExceptionpublic static void handleFirewallRules(ClusterActionEvent event)
public static String prepareRemoteFileUrl(ClusterActionEvent event, String rawUrl) throws IOException
rawUrl - raw url as provided in the configuration fileIOExceptionpublic String getStartFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getStopFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getInstallFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getConfigureFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getCleanupFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getFunctionName(org.apache.commons.configuration.Configuration config, String service, String functionName, String defaultFunction)
public int hashCode()
Objects implementation as the object count will be
relatively small and therefore efficiency is not a concern.Copyright © 2010–2016 Cloudera. All rights reserved.