org.apache.oozie.action.oozie
Class SubWorkflowActionExecutor

java.lang.Object
  extended by org.apache.oozie.action.ActionExecutor
      extended by org.apache.oozie.action.oozie.SubWorkflowActionExecutor

public class SubWorkflowActionExecutor
extends ActionExecutor


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.oozie.action.ActionExecutor
ActionExecutor.Context
 
Field Summary
static String ACTION_TYPE
           
static String LOCAL
           
 
Fields inherited from class org.apache.oozie.action.ActionExecutor
CONF_PREFIX, ERROR_OTHER, MAX_RETRIES, requiresNNJT, RETRY_INTERVAL
 
Constructor Summary
protected SubWorkflowActionExecutor()
           
 
Method Summary
 void check(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action)
          Check if an action has completed.
protected  String checkIfRunning(org.apache.oozie.client.OozieClient oozieClient, String extId)
           
 void end(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action)
          End an action after it has executed.
protected  org.apache.oozie.client.OozieClient getWorkflowClient(ActionExecutor.Context context, String oozieUri)
           
 void initActionType()
          Invoked once at system initialization time.
protected  void injectCallback(ActionExecutor.Context context, org.apache.hadoop.conf.Configuration conf)
           
protected  void injectInline(org.jdom.Element eConf, org.apache.hadoop.conf.Configuration subWorkflowConf)
           
protected  void injectRecovery(String externalId, org.apache.hadoop.conf.Configuration conf)
           
 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 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, registerError, resetInitInfo, setMaxRetries, setRetryInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_TYPE

public static final String ACTION_TYPE
See Also:
Constant Field Values

LOCAL

public static final String LOCAL
See Also:
Constant Field Values
Constructor Detail

SubWorkflowActionExecutor

protected SubWorkflowActionExecutor()
Method Detail

initActionType

public void initActionType()
Description copied from class: ActionExecutor
Invoked once at system initialization time.

It can be used to register error information for the expected exceptions. Exceptions should be register from subclasses to superclasses to ensure proper detection, same thing that it is done in a normal catch.

This method should invoke the ActionExecutor.registerError(java.lang.String, org.apache.oozie.action.ActionExecutorException.ErrorType, java.lang.String) method to register all its possible errors.

Subclasses overriding must invoke super.

Overrides:
initActionType in class ActionExecutor

getWorkflowClient

protected org.apache.oozie.client.OozieClient getWorkflowClient(ActionExecutor.Context context,
                                                                String oozieUri)

injectInline

protected void injectInline(org.jdom.Element eConf,
                            org.apache.hadoop.conf.Configuration subWorkflowConf)
                     throws IOException,
                            ActionExecutorException
Throws:
IOException
ActionExecutorException

injectCallback

protected void injectCallback(ActionExecutor.Context context,
                              org.apache.hadoop.conf.Configuration conf)

injectRecovery

protected void injectRecovery(String externalId,
                              org.apache.hadoop.conf.Configuration conf)

checkIfRunning

protected String checkIfRunning(org.apache.oozie.client.OozieClient oozieClient,
                                String extId)
                         throws org.apache.oozie.client.OozieClientException
Throws:
org.apache.oozie.client.OozieClientException

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.

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.

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.


Copyright © 2013 Apache Software Foundation. All Rights Reserved.