如何在oozie工作协调员中改变价值? [英] How to change value in an oozie job coordinator?
问题描述
我有一个由oozie协调员安排的mapreduce作业,每4个小时运行一次.这个mapreduce作业使用一个参数,比方说k,其值在job.config文件中设置.我想知道是否要在两次运行之间更改此参数的值,它选择更新的(新)值还是坚持原始(旧)值?
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?
推荐答案
实际上,有一种可行的方法可以在运行时动态"获取参数值:
Actually, there is a devious way to "dynamically" fetch a parameter value at run time:
- 在工作流程的开头插入一个空的Shell动作,使用 <捕获输出/> 选项集
- 在shell脚本中,只需从HDFS下载属性文件,然后 将其转储到 STDOUT
- 捕获输出"选项告诉Oozie将 STDOUT 解析为地图(即键/值列表)
- 然后使用E.L.函数以检索适当的值 下一个动作
- 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"]}
${wf:actionData("DummyShellAction")["some.key"]}
http://oozie.apache.org/docs /4.0.0/WorkflowFunctionalSpec.html#a4.2.6_Hadoop_Jobs_EL_Function
这篇关于如何在oozie工作协调员中改变价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!