org.apache.oozie.action.hadoop
Class FsActionExecutor

java.lang.Object
  extended by org.apache.oozie.action.ActionExecutor
      extended by org.apache.oozie.action.hadoop.FsActionExecutor

public class FsActionExecutor
extends ActionExecutor

File system action executor.

This executes the file system mkdir, move and delete commands


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.oozie.action.ActionExecutor
ActionExecutor.Context
 
Field Summary
 
Fields inherited from class org.apache.oozie.action.ActionExecutor
CONF_PREFIX, ERROR_OTHER, MAX_RETRIES, requiresNNJT, RETRY_INTERVAL
 
Constructor Summary
FsActionExecutor()
           
 
Method Summary
 void check(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action)
          Check if an action has completed.
 void delete(ActionExecutor.Context context, org.apache.hadoop.fs.Path path)
          Delete path
 void delete(ActionExecutor.Context context, XConfiguration fsConf, org.apache.hadoop.fs.Path nameNodePath, org.apache.hadoop.fs.Path path)
          Delete path
 void delete(String user, String group, org.apache.hadoop.fs.Path path)
          Delete path
 void end(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action)
          End an action after it has executed.
 org.apache.hadoop.fs.Path getRecoveryPath(ActionExecutor.Context context)
           
 boolean isCompleted(String externalStatus)
          Return if the external status indicates that the action has completed.
 void kill(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action)
          Kill an action.
 void move(ActionExecutor.Context context, org.apache.hadoop.fs.Path source, org.apache.hadoop.fs.Path target, boolean recovery)
          Move source to target
 void move(ActionExecutor.Context context, XConfiguration fsConf, org.apache.hadoop.fs.Path nameNodePath, org.apache.hadoop.fs.Path source, org.apache.hadoop.fs.Path target, boolean recovery)
          Move source to target
 void start(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action)
          Start an action.
 
Methods inherited from class org.apache.oozie.action.ActionExecutor
convertException, disableInit, enableInit, getActionDir, getActionDirPath, getActionSignal, getMaxRetries, getOozieConf, getOozieRuntimeDir, getOozieSystemId, getRetryInterval, getType, initActionType, registerError, resetInitInfo, setMaxRetries, setRetryInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FsActionExecutor

public FsActionExecutor()
Method Detail

delete

public void delete(ActionExecutor.Context context,
                   org.apache.hadoop.fs.Path path)
            throws ActionExecutorException
Delete path

Parameters:
context -
path -
Throws:
ActionExecutorException

delete

public void delete(ActionExecutor.Context context,
                   XConfiguration fsConf,
                   org.apache.hadoop.fs.Path nameNodePath,
                   org.apache.hadoop.fs.Path path)
            throws ActionExecutorException
Delete path

Parameters:
context -
fsConf -
nameNodePath -
path -
Throws:
ActionExecutorException

delete

public void delete(String user,
                   String group,
                   org.apache.hadoop.fs.Path path)
            throws ActionExecutorException
Delete path

Parameters:
user -
group -
path -
Throws:
ActionExecutorException

move

public void move(ActionExecutor.Context context,
                 org.apache.hadoop.fs.Path source,
                 org.apache.hadoop.fs.Path target,
                 boolean recovery)
          throws ActionExecutorException
Move source to target

Parameters:
context -
source -
target -
recovery -
Throws:
ActionExecutorException

move

public void move(ActionExecutor.Context context,
                 XConfiguration fsConf,
                 org.apache.hadoop.fs.Path nameNodePath,
                 org.apache.hadoop.fs.Path source,
                 org.apache.hadoop.fs.Path target,
                 boolean recovery)
          throws ActionExecutorException
Move source to target

Parameters:
context -
fsConf -
nameNodePath -
source -
target -
recovery -
Throws:
ActionExecutorException

check

public void check(ActionExecutor.Context context,
                  org.apache.oozie.client.WorkflowAction action)
           throws ActionExecutorException
Description copied from class: ActionExecutor
Check if an action has completed. This method must be implemented by Async Action Executors.

If the action has completed, the ActionExecutor.Context.setExecutionData(java.lang.String, java.util.Properties) method must be called within this method.

If the action has not completed, the ActionExecutor.Context.setExternalStatus(java.lang.String) method must be called within this method.

Specified by:
check in class ActionExecutor
Parameters:
context - executor context.
action - the action to end.
Throws:
ActionExecutorException - thrown if the action could not be checked.

kill

public void kill(ActionExecutor.Context context,
                 org.apache.oozie.client.WorkflowAction action)
          throws ActionExecutorException
Description copied from class: ActionExecutor
Kill an action.

The ActionExecutor.Context.setEndData(org.apache.oozie.client.WorkflowAction.Status, java.lang.String) method must be called within this method.

Specified by:
kill in class ActionExecutor
Parameters:
context - executor context.
action - the action to kill.
Throws:
ActionExecutorException - thrown if the action could not be killed.

start

public void start(ActionExecutor.Context context,
                  org.apache.oozie.client.WorkflowAction action)
           throws ActionExecutorException
Description copied from class: ActionExecutor
Start an action.

The ActionExecutor.Context.setStartData(java.lang.String, java.lang.String, java.lang.String) method must be called within this method.

If the action has completed, the ActionExecutor.Context.setExecutionData(java.lang.String, java.util.Properties) method must be called within this method.

Specified by:
start in class ActionExecutor
Parameters:
context - executor context.
action - the action to start.
Throws:
ActionExecutorException - thrown if the action could not start.

end

public void end(ActionExecutor.Context context,
                org.apache.oozie.client.WorkflowAction action)
         throws ActionExecutorException
Description copied from class: ActionExecutor
End an action after it has executed.

The ActionExecutor.Context.setEndData(org.apache.oozie.client.WorkflowAction.Status, java.lang.String) method must be called within this method.

Specified by:
end in class ActionExecutor
Parameters:
context - executor context.
action - the action to end.
Throws:
ActionExecutorException - thrown if the action could not end.

isCompleted

public boolean isCompleted(String externalStatus)
Description copied from class: ActionExecutor
Return if the external status indicates that the action has completed.

Specified by:
isCompleted in class ActionExecutor
Parameters:
externalStatus - external status to check.
Returns:
if the external status indicates that the action has completed.

getRecoveryPath

public org.apache.hadoop.fs.Path getRecoveryPath(ActionExecutor.Context context)
                                          throws HadoopAccessorException,
                                                 IOException,
                                                 URISyntaxException
Parameters:
context -
Returns:
Throws:
HadoopAccessorException
IOException
URISyntaxException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.