How do I pass arguments to an Oozie action using oozie.launcher.action.main.class? How do I pass arguments to an Oozie action using oozie.launcher.action.main.class? hadoop hadoop

How do I pass arguments to an Oozie action using oozie.launcher.action.main.class?


As of Oozie 3 (haven't tried Oozie 4 yet), the answer to my main question is: you can't. There is no facility (strangely) for specifying any arguments to your main class defined with the oozie.launcher.action.main.class property.

@Dmitry's suggestion in the comments to just use the Oozie java action works for a Cascading job (or any Hadoop dependent job) because Oozie puts all the Hadoop jars in the classpath when it launches the job.

I've documented a working example of launching a Cascading job from Oozie at my blog here: http://thornydev.blogspot.com/2013/10/launching-cascading-job-from-apache.html

Here is the workflow.xml file that worked for me:

<workflow-app xmlns='uri:oozie:workflow:0.2' name='cascading-wf'>  <start to='stage1' />  <action name='stage1'>    <java>      <job-tracker>${jobTracker}</job-tracker>      <name-node>${nameNode}</name-node>      <configuration>        <property>          <name>mapred.job.queue.name</name>          <value>${queueName}</value>        </property>      </configuration>      <main-class>com.mycompany.MyCascade</main-class>      <java-opts></java-opts>      <arg>/user/myuser/dir1/dir2</arg>      <arg>my-arg-2</arg>      <arg>my-arg-3</arg>      <file>lib/${EXEC}#${EXEC}</file>       <capture-output />    </java>    <ok to="end" />    <error to="fail" />  </action>  <kill name="fail">    <message>FAIL: Oh, the huge manatee!</message>  </kill>  <end name="end"/></workflow-app>

In the job.properties file that accompanies the workflow.xml, the EXEC property is defined as:

EXEC=mybig-shaded-0.0.1-SNAPSHOT.jar

and the job is put into the lib directory below where these two definition files are.