Oozie工作流程中的多个JAVA操作 [英] Multiple JAVA actions in Oozie workflow

查看:122
本文介绍了Oozie工作流程中的多个JAVA操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读过文档,说不可能在工作流中创建一个循环,但我需要每次使用列表项时分别调用main方法 - 因此需要创建一个循环。



一个解决方案是使用子工作流程再次调用工作流程。

是否有其他解决方案?像使用协调员工作?

解决方案




  • 按照您的说法创建一个自定义java操作,该操作使用Oozie Client API运行多个工作流程(列表中的每个项目都有一个工作流程)。然后,您可以并行或串行运行项目并轮询成功/失败。
  • 另一个选项类似于上述,它将使用一些模板化语言,如Apache Velocity,并具有您的自定义动作需要一个模板并将其展开(在运行中生成工作流xml文件),然后再次使用Oozie Client API运行此生成的工作流程。 b

    我更喜欢第二个选项,因为您可以制作一个通用解决方案。


    I read the documentation that it isn't possible to create a loop in a workflow, but I need to invoke the main method separately each time with the list item - hence need to create a loop.

    One solution was to invoke the workflow again using sub-workflow.

    Is there any other solution to this? Like using coordinator jobs?

    解决方案

    Some possible 'hack' solutions that i can think of:

    • Create a custom java action as you say, that uses the Oozie Client API to run several workflows (one for each item in your list). you can then either run the items in parallel or serial and poll for success / failure.
    • Another option, similar to the above would be to use some templateing language like Apache Velocity and have your custom action take a template and expand it (generating a workflow xml file on the fly), before again using the Oozie Client API to run this generated workflow.

    I like the second option more as you can make a generic solution.

    这篇关于Oozie工作流程中的多个JAVA操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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