public class JavaActionExecutor extends ActionExecutor
ActionExecutor.Context
Modifier and Type | Field and Description |
---|---|
static String |
ACL_MODIFY_JOB |
static String |
ACL_VIEW_JOB |
static String |
HADOOP_CHILD_JAVA_ENV |
static String |
HADOOP_CHILD_JAVA_OPTS |
static String |
HADOOP_JOB_TRACKER |
static String |
HADOOP_JOB_TRACKER_2 |
static String |
HADOOP_MAP_JAVA_ENV |
static String |
HADOOP_MAP_JAVA_OPTS |
static String |
HADOOP_MAP_MEMORY_MB |
static String |
HADOOP_NAME_NODE |
static String |
HADOOP_YARN_RM |
static String |
HADOOP_YARN_UBER_MODE |
protected XLog |
LOG |
static String |
MAX_EXTERNAL_STATS_SIZE |
static int |
MAX_EXTERNAL_STATS_SIZE_DEFAULT |
static String |
OOZIE_COMMON_LIBDIR |
static String |
YARN_AM_COMMAND_OPTS |
static String |
YARN_AM_ENV |
static String |
YARN_AM_RESOURCE_MB |
static int |
YARN_MEMORY_MB_MIN |
CONF_PREFIX, ERROR_OTHER, MAX_RETRIES, requiresNNJT, RETRY_INTERVAL
Modifier | Constructor and Description |
---|---|
|
JavaActionExecutor() |
protected |
JavaActionExecutor(String type) |
Modifier and Type | Method and Description |
---|---|
protected void |
addActionLibs(org.apache.hadoop.fs.Path appPath,
org.apache.hadoop.conf.Configuration conf) |
protected void |
addShareLib(org.apache.hadoop.conf.Configuration conf,
String[] actionShareLibNames) |
protected void |
addSystemShareLibForAction(org.apache.hadoop.conf.Configuration conf) |
void |
check(ActionExecutor.Context context,
org.apache.oozie.client.WorkflowAction action)
Check if an action has completed.
|
org.apache.hadoop.mapred.JobConf |
createBaseHadoopConf(ActionExecutor.Context context,
org.jdom.Element actionXml) |
protected org.apache.hadoop.mapred.JobClient |
createJobClient(ActionExecutor.Context context,
org.apache.hadoop.mapred.JobConf jobConf)
Create job client object
|
void |
end(ActionExecutor.Context context,
org.apache.oozie.client.WorkflowAction action)
End an action after it has executed.
|
int |
extractHeapSizeMB(String input) |
protected HashMap<String,CredentialsProperties> |
getActionCredentialsProperties(ActionExecutor.Context context,
org.apache.oozie.client.WorkflowAction action) |
protected void |
getActionData(org.apache.hadoop.fs.FileSystem actionFs,
org.apache.hadoop.mapred.RunningJob runningJob,
org.apache.oozie.client.WorkflowAction action,
ActionExecutor.Context context)
Get the output data of an action.
|
protected boolean |
getCaptureOutput(org.apache.oozie.client.WorkflowAction action) |
static List<Class> |
getCommonLauncherClasses() |
protected CredentialsProperties |
getCredProperties(ActionExecutor.Context context,
String credName) |
protected String |
getDefaultShareLibName(org.jdom.Element actionXml)
Returns the default sharelib name for the action if any.
|
List<Class> |
getLauncherClasses() |
protected String |
getLauncherMain(org.apache.hadoop.conf.Configuration launcherConf,
org.jdom.Element actionXml) |
static int |
getMaxExternalStatsSize()
Get the maximum allowed size of stats
|
protected org.apache.hadoop.mapred.RunningJob |
getRunningJob(ActionExecutor.Context context,
org.apache.oozie.client.WorkflowAction action,
org.apache.hadoop.mapred.JobClient jobClient) |
protected String[] |
getShareLibNames(ActionExecutor.Context context,
org.jdom.Element actionXml,
org.apache.hadoop.conf.Configuration conf)
Return the sharelib names for the action.
|
void |
initActionType()
Invoked once at system initialization time.
|
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.
|
static void |
parseJobXmlAndConfiguration(ActionExecutor.Context context,
org.jdom.Element element,
org.apache.hadoop.fs.Path appPath,
org.apache.hadoop.conf.Configuration conf) |
void |
prepareActionDir(org.apache.hadoop.fs.FileSystem actionFs,
ActionExecutor.Context context) |
protected void |
setActionCompletionData(ActionExecutor.Context context,
org.apache.hadoop.fs.FileSystem actionFs)
Sets some data for the action on completion
|
protected HashMap<String,CredentialsProperties> |
setCredentialPropertyToActionConf(ActionExecutor.Context context,
org.apache.oozie.client.WorkflowAction action,
org.apache.hadoop.conf.Configuration actionConf) |
protected void |
setCredentialTokens(org.apache.hadoop.mapred.JobConf jobconf,
ActionExecutor.Context context,
org.apache.oozie.client.WorkflowAction action,
HashMap<String,CredentialsProperties> credPropertiesMap) |
void |
setLibFilesArchives(ActionExecutor.Context context,
org.jdom.Element actionXml,
org.apache.hadoop.fs.Path appPath,
org.apache.hadoop.conf.Configuration conf) |
void |
start(ActionExecutor.Context context,
org.apache.oozie.client.WorkflowAction action)
Start an action.
|
void |
submitLauncher(org.apache.hadoop.fs.FileSystem actionFs,
ActionExecutor.Context context,
org.apache.oozie.client.WorkflowAction action) |
convertException, disableInit, enableInit, getActionDir, getActionDirPath, getActionSignal, getMaxRetries, getOozieConf, getOozieRuntimeDir, getOozieSystemId, getRetryInterval, getType, registerError, resetInitInfo, setMaxRetries, setRetryInterval
public static final String HADOOP_JOB_TRACKER
public static final String HADOOP_JOB_TRACKER_2
public static final String HADOOP_YARN_RM
public static final String HADOOP_NAME_NODE
public static final String OOZIE_COMMON_LIBDIR
public static final int MAX_EXTERNAL_STATS_SIZE_DEFAULT
public static final String MAX_EXTERNAL_STATS_SIZE
public static final String ACL_VIEW_JOB
public static final String ACL_MODIFY_JOB
public static final String HADOOP_YARN_UBER_MODE
public static final String HADOOP_MAP_MEMORY_MB
public static final String HADOOP_CHILD_JAVA_OPTS
public static final String HADOOP_MAP_JAVA_OPTS
public static final String HADOOP_CHILD_JAVA_ENV
public static final String HADOOP_MAP_JAVA_ENV
public static final String YARN_AM_RESOURCE_MB
public static final String YARN_AM_COMMAND_OPTS
public static final String YARN_AM_ENV
public static final int YARN_MEMORY_MB_MIN
public JavaActionExecutor()
protected JavaActionExecutor(String type)
public static List<Class> getCommonLauncherClasses()
public List<Class> getLauncherClasses()
public void initActionType()
ActionExecutor
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.initActionType
in class ActionExecutor
public static int getMaxExternalStatsSize()
public org.apache.hadoop.mapred.JobConf createBaseHadoopConf(ActionExecutor.Context context, org.jdom.Element actionXml)
public int extractHeapSizeMB(String input)
public static void parseJobXmlAndConfiguration(ActionExecutor.Context context, org.jdom.Element element, org.apache.hadoop.fs.Path appPath, org.apache.hadoop.conf.Configuration conf) throws IOException, ActionExecutorException, HadoopAccessorException, URISyntaxException
public void prepareActionDir(org.apache.hadoop.fs.FileSystem actionFs, ActionExecutor.Context context) throws ActionExecutorException
ActionExecutorException
protected void addShareLib(org.apache.hadoop.conf.Configuration conf, String[] actionShareLibNames) throws ActionExecutorException
ActionExecutorException
protected void addSystemShareLibForAction(org.apache.hadoop.conf.Configuration conf) throws ActionExecutorException
ActionExecutorException
protected void addActionLibs(org.apache.hadoop.fs.Path appPath, org.apache.hadoop.conf.Configuration conf) throws ActionExecutorException
ActionExecutorException
public void setLibFilesArchives(ActionExecutor.Context context, org.jdom.Element actionXml, org.apache.hadoop.fs.Path appPath, org.apache.hadoop.conf.Configuration conf) throws ActionExecutorException
ActionExecutorException
protected String getLauncherMain(org.apache.hadoop.conf.Configuration launcherConf, org.jdom.Element actionXml)
public void submitLauncher(org.apache.hadoop.fs.FileSystem actionFs, ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action) throws ActionExecutorException
ActionExecutorException
protected HashMap<String,CredentialsProperties> setCredentialPropertyToActionConf(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action, org.apache.hadoop.conf.Configuration actionConf) throws Exception
Exception
protected void setCredentialTokens(org.apache.hadoop.mapred.JobConf jobconf, ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action, HashMap<String,CredentialsProperties> credPropertiesMap) throws Exception
Exception
protected HashMap<String,CredentialsProperties> getActionCredentialsProperties(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action) throws Exception
Exception
protected CredentialsProperties getCredProperties(ActionExecutor.Context context, String credName) throws Exception
Exception
public void start(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action) throws ActionExecutorException
ActionExecutor
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.start
in class ActionExecutor
context
- executor context.action
- the action to start.ActionExecutorException
- thrown if the action could not start.public void end(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action) throws ActionExecutorException
ActionExecutor
ActionExecutor.Context.setEndData(org.apache.oozie.client.WorkflowAction.Status, java.lang.String)
method must be called within this
method.end
in class ActionExecutor
context
- executor context.action
- the action to end.ActionExecutorException
- thrown if the action could not end.protected org.apache.hadoop.mapred.JobClient createJobClient(ActionExecutor.Context context, org.apache.hadoop.mapred.JobConf jobConf) throws HadoopAccessorException
context
- jobConf
- HadoopAccessorException
protected org.apache.hadoop.mapred.RunningJob getRunningJob(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action, org.apache.hadoop.mapred.JobClient jobClient) throws Exception
Exception
public void check(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action) throws ActionExecutorException
ActionExecutor
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.check
in class ActionExecutor
context
- executor context.action
- the action to end.ActionExecutorException
- thrown if the action could not be checked.protected void getActionData(org.apache.hadoop.fs.FileSystem actionFs, org.apache.hadoop.mapred.RunningJob runningJob, org.apache.oozie.client.WorkflowAction action, ActionExecutor.Context context) throws HadoopAccessorException, org.jdom.JDOMException, IOException, URISyntaxException
actionFs
- the FileSystem objectrunningJob
- the runningJobaction
- the Workflow actioncontext
- executor contextHadoopAccessorException
org.jdom.JDOMException
IOException
URISyntaxException
protected boolean getCaptureOutput(org.apache.oozie.client.WorkflowAction action) throws org.jdom.JDOMException
org.jdom.JDOMException
public void kill(ActionExecutor.Context context, org.apache.oozie.client.WorkflowAction action) throws ActionExecutorException
ActionExecutor
ActionExecutor.Context.setEndData(org.apache.oozie.client.WorkflowAction.Status, java.lang.String)
method must be called within this method.kill
in class ActionExecutor
context
- executor context.action
- the action to kill.ActionExecutorException
- thrown if the action could not be killed.public boolean isCompleted(String externalStatus)
ActionExecutor
isCompleted
in class ActionExecutor
externalStatus
- external status to check.protected String[] getShareLibNames(ActionExecutor.Context context, org.jdom.Element actionXml, org.apache.hadoop.conf.Configuration conf)
NULL
or empty, it means that the action does not use the action
sharelib.
If a non-empty string, i.e. foo
, it means the action uses the
action sharelib sub-directory foo
and all JARs in the sharelib
foo
directory will be in the action classpath. Multiple sharelib
sub-directories can be specified as a comma separated list.
The resolution is done using the following precedence order:
getDefaultShareLibName()
methodcontext
- executor context.actionXml
- conf
- action configuration.protected String getDefaultShareLibName(org.jdom.Element actionXml)
actionXml
- the action XML fragment.NULL
if none.protected void setActionCompletionData(ActionExecutor.Context context, org.apache.hadoop.fs.FileSystem actionFs) throws IOException, HadoopAccessorException, URISyntaxException
context
- executor contextactionFs
- the FileSystem objectIOException
HadoopAccessorException
URISyntaxException
Copyright © 2014 Apache Software Foundation. All Rights Reserved.