如何在oozie工作协调员中改变价值? [英] How to change value in an oozie job coordinator?

查看:104
本文介绍了如何在oozie工作协调员中改变价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由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:

  1. 在工作流程的开头插入一个空的Shell动作,使用 <捕获输出/> 选项集
  2. 在shell脚本中,只需从HDFS下载属性文件,然后 将其转储到 STDOUT
  3. 捕获输出"选项告诉Oozie将 STDOUT 解析为地图(即键/值列表)
  4. 然后使用E.L.函数以检索适当的值 下一个动作
  1. insert a dummy Shell Action at the beginning of the Workflow, with <capture-output/> option set
  2. in the shell script, just download a properties file from HDFS and dump it to STDOUT
  3. the "capture-output" option tells Oozie to parse STDOUT into a Map (i.e. a key/value list)
  4. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆