You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by Max Ziff <zi...@verticloud.com> on 2012/06/14 01:31:03 UTC
questions about scripts through the java action
Hi All,
I am exploring the possibilities of using ruby scripts through the java
action. Has anyone had good experience with this? Here are some of the
things I'm thinking about.
1. The documentation for the java action at
http://incubator.apache.org/oozie/docs/3.1.3/docs/WorkflowFunctionalSpec.html#a3.2.7_Java_Actionsays:
A java action can create a Hadoop configuration. The Hadoop configuration
is made available as a local file to the Java application in its running
directory, the file name is oozie-action.conf.xml . Similar to map-reduce
and pig actions it is possible to refer a job.xml file and using inline
configuration properties. For repeated configuration properties later
values override earlier ones.
I don't understand what this means or what it's intended for. Is this to
support communication of configuration from oozie's environment to the java
action? It seems that the "capture-output" option is intended to
communicate configuration the other way.
2. This page: https://github.com/yahoo/oozie/wiki/Oozie-WF-use-cases, under
the "Java-Main Action with Script support" section, gives sample
"testShell" class and "CmdRunner" classes. It seems that this would be a
common enough use-case that it might be helpful to embody this code in the
codeline - perhaps even as a script action. What do you think? To me, it
seems that it would be conceptually clean if there were a script action
that was configured similarly to the streaming action and supported
capture-output like the java action, something like:
<action name="my-script">
<script>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<command-line>xx/bin/my-script -i ${input} --foo ${bar}</command-line>
<configuration> <property> <name>mapred.job.queue.name
</name> <value>${queueName}</value> </property> </configuration>
<archive>mystuff.tar#xx</archive>
<capture-output/>
</script>
<ok to="decision1" />
<error to="fail" />
</action>
<decision name="decision1">
<switch>
<case to="end">${(wf:actionData('my-script')['key1'] ==
"value1") and (wf:actionData('java2')['key2'] == "value2")}</case>
<default to="fail" />
</switch>
</decision>
What patterns has anyone followed to do things like this?
Thanks,
Max
P.S. See you at the summit tomorrow? :-)