oozie hpdl参数分析
2013-11-25 19:46
309 查看
一 oozie设置参数方式
1)客户端调用时,例如:
Properties conf = wc.createConfiguration(); conf.setProperty("user.name", "oozie"); conf.setProperty("dataflow.taskMangerURL", "http://172.16.11.253:8081/bdi-api/TaskManagerServlet"); jobId = wc.run(conf);
2)Global Configurations
3)action的子标签,例:
<action name='a2'> <dataflow xmlns='uri:oozie:dataflow-action:0.1'> <dataflowId>a2</dataflowId> </dataflow> <ok to='end'/> <error to='fail'/> </action>
二 全局配置
19 Global Configurations
Oozie allows a global section to reduce the redundant job-tracker and name-node declarations for each action. The user can define aglobal section in the beginning of the workflow.xml . The global section may contain the job-xml, configuration, job-tracker,
or name-node that the user would like to set for every action. If a user then redefines one of these in a specific action node, Oozie will update use the specific declaration instead of the global one for that action.
Example of a global element:
<workflow-app xmlns="uri:oozie:workflow:0.4" name="wf-name"> <global> <job-tracker>${job-tracker}</job-tracker> <name-node>${namd-node}</name-node> <job-xml>job1.xml</job-xml> <configuration> <property> <name>mapred.job.queue.name</name> <value>${queueName}</value> </property> </configuration> </global>
xsd片段:
<xs:complexType name="GLOBAL"> <xs:sequence> <xs:element name="job-tracker" type="xs:string" minOccurs="0" maxOccurs="1"/> <xs:element name="name-node" type="xs:string" minOccurs="0" maxOccurs="1"/> <xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="configuration" type="workflow:CONFIGURATION" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType>
注:在实际运行当中<global>的</configuration>子标签将内容将写入活动的配置,例如:
hpdl:
<workflow-app xmlns='uri:oozie:workflow:0.4' name='workflowId1'> <global> <configuration> <property> <name>dataflow.taskMangerURL</name> <value>http://172.16.11.253:8081/bdi-api/TaskManagerServlet</value> </property> </configuration> </global>
<start to='a2'/> <action name='a2'> <dataflow xmlns='uri:oozie:dataflow-action:0.1'> <dataflowId>a2</dataflowId> </dataflow> <ok to='end'/> <error to='fail'/> </action>
通过在action方法中action.getConf()取得的action配置实际值为:
<dataflow xmlns="uri:oozie:dataflow-action:0.1"> <dataflowId>a2</dataflowId> <configuration> <property> <name>dataflow.taskMangerURL</name> <value>http://172.16.11.253:8081/bdi-api/TaskManagerServlet</value> </property> </configuration> </dataflow>
三 疑问
除了直接解析action的xml,如何在oozie中通过本身自带的方法取属性值,如下列Property中的值:
Properties conf = wc.createConfiguration(); conf.setProperty("user.name", "oozie"); conf.setProperty("dataflow.taskMangerURL", "http://172.16.11.253:8081/bdi-api/TaskManagerServlet"); String jobId=""; try { jobId = wc.run(conf);
相关文章推荐
- 用递归的方法汉诺塔求次数
- Delphi XE5 for Android (十一)
- 单例模式(单子模式)
- Python 网络编程---简单的服务器与客户端实现---阻塞式编写
- 数据结构B树
- 蓝桥杯全国软件大赛试题——java最小距离问题
- 去掉vs2010字符串下红色波浪线
- HIbernate学习笔记(六) 关系映射之多对多
- poj1700
- csu 1067 1vs1
- JQuery表单验证插件EasyValidator简单易用!
- 基于Android移动终端的控制系统监控软件开发
- Delphi XE5 for Android (十)
- Struts2 使用基本流程
- JavaWeb_08_jsp_简单计算器(jsp+javaBean模式)
- 2012 Asia Tianjin Regional Contest
- HIbernate学习笔记(五) 关系映射之一对多与多对一
- Delphi XE5 for Android (九)
- JNI 在命令行窗口输入字符,不显所输入字符,显指定的掩饰符
- hdu1429(BFS+状态压缩)