This project has retired. For details please refer to its Attic page.
ShellMain (Apache Oozie Core 3.3.2 API)

org.apache.oozie.action.hadoop
Class ShellMain

java.lang.Object
  extended by org.apache.oozie.action.hadoop.LauncherMain
      extended by org.apache.oozie.action.hadoop.ShellMain

public class ShellMain
extends LauncherMain


Field Summary
static String CONF_OOZIE_SHELL_ARGS
           
static String CONF_OOZIE_SHELL_CAPTURE_OUTPUT
           
static String CONF_OOZIE_SHELL_ENVS
           
static String CONF_OOZIE_SHELL_EXEC
           
static String OOZIE_ACTION_CONF_XML
           
 
Fields inherited from class org.apache.oozie.action.hadoop.LauncherMain
HADOOP_JOBS
 
Constructor Summary
ShellMain()
           
 
Method Summary
protected  String getExec(org.apache.hadoop.conf.Configuration actionConf)
          Retrieve the executable name that was originally specified to Workflow.xml.
protected  List<String> getShellArguments(org.apache.hadoop.conf.Configuration actionConf)
          Retrieve the list of arguments that were originally specified to Workflow.xml.
protected  Thread[] handleShellOutput(Process p, boolean captureOutput)
          Print the output written by the Shell execution in its stdout/stderr.
protected  org.apache.hadoop.conf.Configuration loadActionConf()
          Read action configuration passes through action xml file.
static void main(String[] args)
           
protected  void printCommand(ArrayList<String> cmdArray, Map<String,String> envp)
          Print the command including the arguments as well as the environment setup
protected  void run(String[] args)
           
 
Methods inherited from class org.apache.oozie.action.hadoop.LauncherMain
getHadoopJobIds, logMasking, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_OOZIE_SHELL_ARGS

public static final String CONF_OOZIE_SHELL_ARGS
See Also:
Constant Field Values

CONF_OOZIE_SHELL_EXEC

public static final String CONF_OOZIE_SHELL_EXEC
See Also:
Constant Field Values

CONF_OOZIE_SHELL_ENVS

public static final String CONF_OOZIE_SHELL_ENVS
See Also:
Constant Field Values

CONF_OOZIE_SHELL_CAPTURE_OUTPUT

public static final String CONF_OOZIE_SHELL_CAPTURE_OUTPUT
See Also:
Constant Field Values

OOZIE_ACTION_CONF_XML

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

ShellMain

public ShellMain()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Parameters:
args - Invoked from LauncherMapper:map()
Throws:
Exception

run

protected void run(String[] args)
            throws Exception
Specified by:
run in class LauncherMain
Throws:
Exception

handleShellOutput

protected Thread[] handleShellOutput(Process p,
                                     boolean captureOutput)
                              throws IOException
Print the output written by the Shell execution in its stdout/stderr. Also write the stdout output to a file for capturing.

Parameters:
p - process
captureOutput - indicates if STDOUT should be captured or not.
Returns:
Array of threads (one for stdout and another one for stderr processing
Throws:
IOException - thrown if an IO error occurrs.

printCommand

protected void printCommand(ArrayList<String> cmdArray,
                            Map<String,String> envp)
Print the command including the arguments as well as the environment setup

Parameters:
cmdArray - :Command Array
envp - :Environment array

getShellArguments

protected List<String> getShellArguments(org.apache.hadoop.conf.Configuration actionConf)
Retrieve the list of arguments that were originally specified to Workflow.xml.

Parameters:
actionConf -
Returns:
argument list

getExec

protected String getExec(org.apache.hadoop.conf.Configuration actionConf)
Retrieve the executable name that was originally specified to Workflow.xml.

Parameters:
actionConf -
Returns:
executable

loadActionConf

protected org.apache.hadoop.conf.Configuration loadActionConf()
                                                       throws IOException
Read action configuration passes through action xml file.

Returns:
action Configuration
Throws:
IOException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.