|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.oozie.action.ActionExecutor
org.apache.oozie.action.ssh.SshActionExecutor
public class SshActionExecutor
Ssh action executor.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.oozie.action.ActionExecutor |
---|
ActionExecutor.Context |
Field Summary | |
---|---|
static java.lang.String |
ACTION_TYPE
|
static java.lang.String |
CONF_SSH_ALLOW_USER_AT_HOST
Configuration parameter which specifies whether the specified ssh user is allowed, or has to be the job user. |
static java.lang.String |
DELETE_TMP_DIR
|
static java.lang.String |
ERR_AUTH_FAILED
|
static java.lang.String |
ERR_COULD_NOT_CONNECT
|
static java.lang.String |
ERR_EXCEDE_LEN
|
static java.lang.String |
ERR_EXECUTION_FAILED
|
static java.lang.String |
ERR_FNF
|
static java.lang.String |
ERR_HOST_RESOLUTION
|
static java.lang.String |
ERR_NO_EXEC_PERM
|
static java.lang.String |
ERR_SETUP_FAILED
|
static java.lang.String |
ERR_UNKNOWN_ERROR
|
static java.lang.String |
ERR_USER_MISMATCH
|
static java.lang.String |
HTTP_COMMAND
|
static java.lang.String |
HTTP_COMMAND_OPTIONS
|
protected static java.lang.String |
SCP_COMMAND_BASE
|
protected static java.lang.String |
SSH_COMMAND_BASE
|
protected static java.lang.String |
SSH_COMMAND_OPTIONS
|
Fields inherited from class org.apache.oozie.action.ActionExecutor |
---|
CONF_PREFIX, ERROR_OTHER, MAX_RETRIES, RETRY_INTERVAL |
Constructor Summary | |
---|---|
protected |
SshActionExecutor()
|
Method Summary | |
---|---|
void |
check(ActionExecutor.Context context,
WorkflowAction action)
Check ssh action status. |
protected java.lang.String |
doExecute(java.lang.String host,
java.lang.String dirLocation,
java.lang.String cmnd,
java.lang.String args,
boolean ignoreOutput,
WorkflowAction action,
java.lang.String recoveryId)
Execute the ssh command. |
void |
end(ActionExecutor.Context context,
WorkflowAction action)
End action execution. |
int |
executeCommand(java.lang.String command)
Utility method to execute command. |
protected WorkflowAction.Status |
getActionStatus(ActionExecutor.Context context,
WorkflowAction action)
Get action status. |
java.lang.String |
getRemoteFileName(ActionExecutor.Context context,
WorkflowAction action,
java.lang.String fileExtension,
boolean dirOnly,
boolean useExtId)
Get remote host working location. |
void |
initActionType()
Initialize Action. |
boolean |
isCompleted(java.lang.String externalStatus)
Return if the external status indicates that the action has completed. |
void |
kill(ActionExecutor.Context context,
WorkflowAction action)
Kill ssh action. |
protected java.lang.String |
setupRemote(java.lang.String host,
ActionExecutor.Context context,
WorkflowAction action)
Do ssh action execution setup on remote host. |
void |
start(ActionExecutor.Context context,
WorkflowAction action)
Start the ssh action execution. |
Methods inherited from class org.apache.oozie.action.ActionExecutor |
---|
convertException, disableInit, enableInit, getActionDir, getActionDirPath, getActionSignal, getMaxRetries, getOozieConf, getOozieRuntimeDir, getOozieSystemId, getRetryInterval, getType, registerError, resetInitInfo, setMaxRetries, setRetryInterval |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ACTION_TYPE
public static final java.lang.String CONF_SSH_ALLOW_USER_AT_HOST
protected static final java.lang.String SSH_COMMAND_OPTIONS
protected static final java.lang.String SSH_COMMAND_BASE
protected static final java.lang.String SCP_COMMAND_BASE
public static final java.lang.String ERR_SETUP_FAILED
public static final java.lang.String ERR_EXECUTION_FAILED
public static final java.lang.String ERR_UNKNOWN_ERROR
public static final java.lang.String ERR_COULD_NOT_CONNECT
public static final java.lang.String ERR_HOST_RESOLUTION
public static final java.lang.String ERR_FNF
public static final java.lang.String ERR_AUTH_FAILED
public static final java.lang.String ERR_NO_EXEC_PERM
public static final java.lang.String ERR_USER_MISMATCH
public static final java.lang.String ERR_EXCEDE_LEN
public static final java.lang.String DELETE_TMP_DIR
public static final java.lang.String HTTP_COMMAND
public static final java.lang.String HTTP_COMMAND_OPTIONS
Constructor Detail |
---|
protected SshActionExecutor()
Method Detail |
---|
public void initActionType()
initActionType
in class ActionExecutor
public void check(ActionExecutor.Context context, WorkflowAction action) throws ActionExecutorException
check
in class ActionExecutor
context
- action execution context.action
- action object.
ActionExecutorException
- thrown if the action could not be checked.public void kill(ActionExecutor.Context context, WorkflowAction action) throws ActionExecutorException
kill
in class ActionExecutor
context
- action execution context.action
- object.
ActionExecutorException
- thrown if the action could not be killed.public void start(ActionExecutor.Context context, WorkflowAction action) throws ActionExecutorException
start
in class ActionExecutor
context
- action execution context.action
- action object.
ActionExecutorException
- thrown if the action could not start.public java.lang.String getRemoteFileName(ActionExecutor.Context context, WorkflowAction action, java.lang.String fileExtension, boolean dirOnly, boolean useExtId)
context
- action execution contextaction
- ActionfileExtension
- Extension to be added to file namedirOnly
- Get the Directory onlyuseExtId
- Flag to use external ID in the path
public int executeCommand(java.lang.String command) throws java.io.IOException, java.lang.InterruptedException
command
- Command to execute as String.
java.io.IOException
- if process exits with status nonzero.
java.lang.InterruptedException
- if process does not run properly.protected java.lang.String setupRemote(java.lang.String host, ActionExecutor.Context context, WorkflowAction action) throws java.io.IOException, java.lang.InterruptedException
host
- host name.context
- action execution context.action
- action object.
java.io.IOException
- thrown if failed to setup.
java.lang.InterruptedException
- thrown if any interruption happens.protected java.lang.String doExecute(java.lang.String host, java.lang.String dirLocation, java.lang.String cmnd, java.lang.String args, boolean ignoreOutput, WorkflowAction action, java.lang.String recoveryId) throws java.io.IOException, java.lang.InterruptedException
host
- hostname.dirLocation
- location of the base and wrapper scripts.cmnd
- command to be executed.args
- command arguments.ignoreOutput
- ignore output option.action
- action object.recoveryId
- action id + run number to enable recovery in rerun
java.io.IOException
- thrown if failed to run the command.
java.lang.InterruptedException
- thrown if any interruption happens.public void end(ActionExecutor.Context context, WorkflowAction action) throws ActionExecutorException
end
in class ActionExecutor
context
- action execution context.action
- action object.
ActionExecutorException
- thrown if action end execution fails.protected WorkflowAction.Status getActionStatus(ActionExecutor.Context context, WorkflowAction action) throws ActionExecutorException
action
- action object.
ActionExecutorException
- thrown if there is any error in getting status.public boolean isCompleted(java.lang.String externalStatus)
ActionExecutor
isCompleted
in class ActionExecutor
externalStatus
- external status to check.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |