public static class ActionXCommand.ActionExecutorContext extends Object implements ActionExecutor.Context
| Modifier and Type | Field and Description |
|---|---|
protected WorkflowActionBean |
action |
protected WorkflowJobBean |
workflow |
| Constructor and Description |
|---|
ActionXCommand.ActionExecutorContext(WorkflowJobBean workflow,
WorkflowActionBean action,
boolean isRetry,
boolean isUserRetry)
Constructing the ActionExecutorContext, setting the private members
and constructing the proto configuration
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
Job.Status |
getJobStatus() |
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.
|
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 |
isShouldEndWF() |
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(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 |
setJobStatus(Job.Status jobStatus) |
void |
setShouldEndWF(boolean shouldEndWF) |
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.
|
void |
setVarToWorkflow(String name,
String value)
This is not thread safe, don't use if workflowjob is shared among multiple actions command
|
protected final WorkflowJobBean workflow
protected final WorkflowActionBean action
public ActionXCommand.ActionExecutorContext(WorkflowJobBean workflow, WorkflowActionBean action, boolean isRetry, boolean isUserRetry)
public String getCallbackUrl(String externalStatusVar)
ActionExecutor.ContextgetCallbackUrl in interface ActionExecutor.ContextexternalStatusVar - variable for the caller to inject the external status.public org.apache.hadoop.conf.Configuration getProtoActionConf()
ActionExecutor.ContextgetProtoActionConf in interface ActionExecutor.Contextpublic WorkflowJob getWorkflow()
ActionExecutor.ContextgetWorkflow in interface ActionExecutor.Contextpublic WorkflowAction getAction()
public ELEvaluator getELEvaluator()
ActionExecutor.ContextgetELEvaluator in interface ActionExecutor.Contextpublic void setVar(String name, String value)
ActionExecutor.ContextConvenience method that prefixes the variable name with the action name plus a '.'.
setVar in interface ActionExecutor.Contextname - variable name.value - variable value, null removes the variable.public void setVarToWorkflow(String name, String value)
name - value - public String getVar(String name)
ActionExecutor.ContextConvenience method that prefixes the variable name with the action name plus a '.'.
getVar in interface ActionExecutor.Contextname - variable name.null if not set.public void setStartData(String externalId, String trackerUri, String consoleUrl)
ActionExecutor.ContextsetStartData in interface ActionExecutor.ContextexternalId - the action external ID.trackerUri - the action tracker URI.consoleUrl - the action console URL.public void setStartTime()
public void setExecutionData(String externalStatus, Properties actionData)
ActionExecutor.ContextWorkflowAction.Status.DONEsetExecutionData in interface ActionExecutor.ContextexternalStatus - the action external end status.actionData - the action data on completion, null if none.public void setExecutionStats(String jsonStats)
ActionExecutor.ContextWorkflowAction.Status.DONEsetExecutionStats in interface ActionExecutor.ContextjsonStats - the JSON string representation of the stats.public void setExternalChildIDs(String externalChildIDs)
ActionExecutor.ContextWorkflowAction.Status.DONEsetExternalChildIDs in interface ActionExecutor.ContextexternalChildIDs - the external child IDs as a comma-delimited string.public void setEndData(WorkflowAction.Status status, String signalValue)
ActionExecutor.ContextsetEndData in interface ActionExecutor.Contextstatus - the action end status, it can be WorkflowAction.Status.OK or
WorkflowAction.Status.ERROR.signalValue - the action external end status.public boolean isRetry()
ActionExecutor.ContextisRetry in interface ActionExecutor.Contextpublic boolean isUserRetry()
public boolean isStarted()
public boolean isExecuted()
public boolean isEnded()
public void setExternalStatus(String externalStatus)
ActionExecutor.ContextsetExternalStatus in interface ActionExecutor.ContextexternalStatus - the external status.public String getRecoveryId()
ActionExecutor.ContextgetRecoveryId in interface ActionExecutor.Contextpublic org.apache.hadoop.fs.Path getActionDir() throws HadoopAccessorException, IOException, URISyntaxException
getActionDir in interface ActionExecutor.ContextHadoopAccessorExceptionIOExceptionURISyntaxExceptionpublic org.apache.hadoop.fs.FileSystem getAppFileSystem() throws HadoopAccessorException, IOException, URISyntaxException
getAppFileSystem in interface ActionExecutor.ContextHadoopAccessorExceptionIOExceptionURISyntaxExceptionpublic void setErrorInfo(String str, String exMsg)
setErrorInfo in interface ActionExecutor.Contextpublic boolean isShouldEndWF()
public void setShouldEndWF(boolean shouldEndWF)
public Job.Status getJobStatus()
public void setJobStatus(Job.Status jobStatus)
Copyright © 2018 Apache Software Foundation. All rights reserved.