org.apache.oozie.command.wf
Class ActionXCommand.ActionExecutorContext

java.lang.Object
  extended by org.apache.oozie.command.wf.ActionXCommand.ActionExecutorContext
All Implemented Interfaces:
ActionExecutor.Context
Enclosing class:
ActionXCommand<T>

public static class ActionXCommand.ActionExecutorContext
extends Object
implements ActionExecutor.Context

Workflow action executor context


Constructor Summary
ActionXCommand.ActionExecutorContext(WorkflowJobBean workflow, WorkflowActionBean action, boolean isRetry, boolean isUserRetry)
          Constructing the ActionExecutorContext, setting the private members and constructing the proto configuration
 
Method Summary
 org.apache.oozie.client.WorkflowAction getAction()
          Returns the workflow action of the given action context
 org.apache.hadoop.fs.Path getActionDir()
           
 org.apache.hadoop.fs.FileSystem getAppFileSystem()
           
 String getCallbackUrl(String externalStatusVar)
          Create the callback URL for the action.
 ELEvaluator getELEvaluator()
          Return an ELEvaluator with the context injected.
 org.apache.hadoop.conf.Configuration getProtoActionConf()
          Return a proto configuration for actions with auth properties already set.
 String getRecoveryId()
          Get the Action Recovery ID.
 String getVar(String name)
          Get a workflow action variable.
 org.apache.oozie.client.WorkflowJob getWorkflow()
          Return the workflow job.
 boolean isEnded()
          Returns whether setEndData has been called or not.
 boolean isExecuted()
          Returns whether setExecutionData has been called or not.
 boolean isRetry()
          Return if the executor invocation is a retry or not.
 boolean isStarted()
          Returns whether setStartData has been called or not.
 boolean isUserRetry()
          Return if the executor invocation is a user retry or not.
 void setEndData(org.apache.oozie.client.WorkflowAction.Status status, String signalValue)
          Set the action end completion information for a completed action.
 void setErrorInfo(String str, String exMsg)
           
 void setExecutionData(String externalStatus, Properties actionData)
          Set the action execution completion information for an action.
 void setExecutionStats(String jsonStats)
          Set execution statistics information for a particular action.
 void setExternalChildIDs(String externalChildIDs)
          Set external child IDs for a particular action (Eg: pig).
 void setExternalStatus(String externalStatus)
          Sets the external status for the action in context.
 void setStartData(String externalId, String trackerUri, String consoleUrl)
          Set the action tracking information for an successfully started action.
 void setStartTime()
          Setting the start time of the action
 void setVar(String name, String value)
          Set a workflow action variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionXCommand.ActionExecutorContext

public ActionXCommand.ActionExecutorContext(WorkflowJobBean workflow,
                                            WorkflowActionBean action,
                                            boolean isRetry,
                                            boolean isUserRetry)
Constructing the ActionExecutorContext, setting the private members and constructing the proto configuration

Method Detail

getCallbackUrl

public String getCallbackUrl(String externalStatusVar)
Description copied from interface: ActionExecutor.Context
Create the callback URL for the action.

Specified by:
getCallbackUrl in interface ActionExecutor.Context
Parameters:
externalStatusVar - variable for the caller to inject the external status.
Returns:
the callback URL.

getProtoActionConf

public org.apache.hadoop.conf.Configuration getProtoActionConf()
Description copied from interface: ActionExecutor.Context
Return a proto configuration for actions with auth properties already set.

Specified by:
getProtoActionConf in interface ActionExecutor.Context
Returns:
a proto configuration for actions with auth properties already set.

getWorkflow

public org.apache.oozie.client.WorkflowJob getWorkflow()
Description copied from interface: ActionExecutor.Context
Return the workflow job.

Specified by:
getWorkflow in interface ActionExecutor.Context
Returns:
the workflow job.

getAction

public org.apache.oozie.client.WorkflowAction getAction()
Returns the workflow action of the given action context

Returns:
the workflow action of the given action context

getELEvaluator

public ELEvaluator getELEvaluator()
Description copied from interface: ActionExecutor.Context
Return an ELEvaluator with the context injected.

Specified by:
getELEvaluator in interface ActionExecutor.Context
Returns:
configured ELEvaluator.

setVar

public void setVar(String name,
                   String value)
Description copied from interface: ActionExecutor.Context
Set a workflow action variable.

Convenience method that prefixes the variable name with the action name plus a '.'.

Specified by:
setVar in interface ActionExecutor.Context
Parameters:
name - variable name.
value - variable value, null removes the variable.

getVar

public String getVar(String name)
Description copied from interface: ActionExecutor.Context
Get a workflow action variable.

Convenience method that prefixes the variable name with the action name plus a '.'.

Specified by:
getVar in interface ActionExecutor.Context
Parameters:
name - variable name.
Returns:
the variable value, null if not set.

setStartData

public void setStartData(String externalId,
                         String trackerUri,
                         String consoleUrl)
Description copied from interface: ActionExecutor.Context
Set the action tracking information for an successfully started action.

Specified by:
setStartData in interface ActionExecutor.Context
Parameters:
externalId - the action external ID.
trackerUri - the action tracker URI.
consoleUrl - the action console URL.

setStartTime

public void setStartTime()
Setting the start time of the action


setExecutionData

public void setExecutionData(String externalStatus,
                             Properties actionData)
Description copied from interface: ActionExecutor.Context
Set the action execution completion information for an action. The action status is set to WorkflowAction.Status.DONE

Specified by:
setExecutionData in interface ActionExecutor.Context
Parameters:
externalStatus - the action external end status.
actionData - the action data on completion, null if none.

setExecutionStats

public void setExecutionStats(String jsonStats)
Description copied from interface: ActionExecutor.Context
Set execution statistics information for a particular action. The action status is set to WorkflowAction.Status.DONE

Specified by:
setExecutionStats in interface ActionExecutor.Context
Parameters:
jsonStats - the JSON string representation of the stats.

setExternalChildIDs

public void setExternalChildIDs(String externalChildIDs)
Description copied from interface: ActionExecutor.Context
Set external child IDs for a particular action (Eg: pig). The action status is set to WorkflowAction.Status.DONE

Specified by:
setExternalChildIDs in interface ActionExecutor.Context
Parameters:
externalChildIDs - the external child IDs as a comma-delimited string.

setEndData

public void setEndData(org.apache.oozie.client.WorkflowAction.Status status,
                       String signalValue)
Description copied from interface: ActionExecutor.Context
Set the action end completion information for a completed action.

Specified by:
setEndData in interface ActionExecutor.Context
Parameters:
status - the action end status, it can be WorkflowAction.Status.OK or WorkflowAction.Status.ERROR.
signalValue - the action external end status.

isRetry

public boolean isRetry()
Description copied from interface: ActionExecutor.Context
Return if the executor invocation is a retry or not.

Specified by:
isRetry in interface ActionExecutor.Context
Returns:
if the executor invocation is a retry or not.

isUserRetry

public boolean isUserRetry()
Return if the executor invocation is a user retry or not.

Returns:
if the executor invocation is a user retry or not.

isStarted

public boolean isStarted()
Returns whether setStartData has been called or not.

Returns:
true if start completion info has been set.

isExecuted

public boolean isExecuted()
Returns whether setExecutionData has been called or not.

Returns:
true if execution completion info has been set, otherwise false.

isEnded

public boolean isEnded()
Returns whether setEndData has been called or not.

Returns:
true if end completion info has been set.

setExternalStatus

public void setExternalStatus(String externalStatus)
Description copied from interface: ActionExecutor.Context
Sets the external status for the action in context.

Specified by:
setExternalStatus in interface ActionExecutor.Context
Parameters:
externalStatus - the external status.

getRecoveryId

public String getRecoveryId()
Description copied from interface: ActionExecutor.Context
Get the Action Recovery ID.

Specified by:
getRecoveryId in interface ActionExecutor.Context
Returns:
recovery ID.

getActionDir

public org.apache.hadoop.fs.Path getActionDir()
                                       throws HadoopAccessorException,
                                              IOException,
                                              URISyntaxException
Specified by:
getActionDir in interface ActionExecutor.Context
Throws:
HadoopAccessorException
IOException
URISyntaxException

getAppFileSystem

public org.apache.hadoop.fs.FileSystem getAppFileSystem()
                                                 throws HadoopAccessorException,
                                                        IOException,
                                                        URISyntaxException
Specified by:
getAppFileSystem in interface ActionExecutor.Context
Returns:
filesystem handle for the application deployment fs.
Throws:
HadoopAccessorException
IOException
URISyntaxException

setErrorInfo

public void setErrorInfo(String str,
                         String exMsg)
Specified by:
setErrorInfo in interface ActionExecutor.Context


Copyright © 2012 Apache Software Foundation. All Rights Reserved.