I have a mapreduce job which is scheduled by an oozie coordinator and runs every 4 hours. This mapreduce job takes a parameter, let's say k, whose value is set in the job.config file. I'd like to know if I change the value of this parameter between two runs, does it pick the updated (new) value or it sticks to the original (old) value?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
if the job is in runing mode, it will stick to Old parameter it self, and if the job is in waiting to schedule run, then it will take the latest value :).
回答2:
Actually, there is a devious way to "dynamically" fetch a parameter value at run time:
- insert a dummy Shell Action at the beginning of the Workflow, with <capture-output/> option set
- in the shell script, just download a properties file from HDFS and dump it to STDOUT
- the "capture-output" option tells Oozie to parse STDOUT into a Map (i.e. a key/value list)
- then use an E.L. function to retrieve the appropriate value(s) in the next Actions
${wf:actionData("DummyShellAction")["some.key"]}
http://oozie.apache.org/docs/4.0.0/WorkflowFunctionalSpec.html#a4.2.6_Hadoop_Jobs_EL_Function