使用 Oozie Java API 在 Apache oozie 中获取正在运行的协调器作业的所有工作流

问题描述

我正在运行多个协调员作业。每个协调器启动多个工作流。我想要的是,如果任何工作流程失败,我希望它重新运行。我只关心那些协调器处于运行状态的工作流。

我正在尝试使用 Apache Oozie Java API 编写一个监视器应用程序来实现这一点。

这是我的代码,用于获取协调器仍处于运行状态的失败工作流列表。

String oozieUrl = "https://cluster002-mst-02.cloud.in.guavus.com:11443/oozie/";

// My oozie is SSL enabled.
Properties properties = System.getProperties();
properties.setProperty("javax.net.ssl.trustStore","src/main/resources/truststore.jks");
properties.setProperty("javax.net.ssl.trustStorePassword","admin123");
System.setProperties(properties);

OozieClient oozieClient = new OozieClient(oozieUrl);

// Get all the running co-ordinators
List<CoordinatorJob> coordinatorJobList = this.oozieClient.getCoordJobsInfo("status=RUNNING",Integer.MAX_VALUE);

// Picking only one coordinator for simplicity.
CoordinatorJob coordinatorJob = coordinatorJobList.get(0);

// Get All the actions of this coordinator.
// Issue is that I am getting action list as empty ??????????
List<CoordinatorAction> action = coordinatorJob.getActions();

根据上面的代码片段,我能够获取正在运行的协调器,但我无法获取与协调器对应的操作(优化工作流)。

我通过 Oozie CLI 检查,协调器作业运行良好,没有任何问题。

我可以通过 Oozie CLI 实现同样的功能,但我想用 Java 方式实现。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...