You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by as...@apache.org on 2019/05/29 09:21:38 UTC

[oozie] branch master updated: OOZIE-3393 amend Add Oozie instrumentation delayed metric in CoordMaterializeTriggerService (zuston via asalamon74)

This is an automated email from the ASF dual-hosted git repository.

asalamon74 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/oozie.git


The following commit(s) were added to refs/heads/master by this push:
     new aaa0c7d  OOZIE-3393 amend Add Oozie instrumentation delayed metric in CoordMaterializeTriggerService (zuston via asalamon74)
aaa0c7d is described below

commit aaa0c7de73d76010de8646925af08442949cc3a2
Author: Andras Salamon <as...@apache.org>
AuthorDate: Wed May 29 11:20:56 2019 +0200

    OOZIE-3393 amend Add Oozie instrumentation delayed metric in CoordMaterializeTriggerService (zuston via asalamon74)
---
 core/src/main/java/org/apache/oozie/CoordinatorJobBean.java           | 3 ++-
 .../java/org/apache/oozie/executor/jpa/CoordJobQueryExecutor.java     | 4 +++-
 .../java/org/apache/oozie/service/CoordMaterializeTriggerService.java | 2 +-
 release-log.txt                                                       | 1 +
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java b/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java
index 2a936d6..ad3b0ee 100644
--- a/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java
+++ b/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java
@@ -157,7 +157,8 @@ import org.json.simple.JSONObject;
                 + "AND (w.pauseTimestamp IS NULL OR w.pauseTimestamp > w.nextMaterializedTimestamp))) "
                 + "order by w.lastModifiedTimestamp"),
 
-        @NamedQuery(name = "GET_COORD_JOBS_OLDER_FOR_MATERIALIZATION", query = "select w.id from CoordinatorJobBean w "
+        @NamedQuery(name = "GET_COORD_JOBS_OLDER_FOR_MATERIALIZATION", query = "select w.id, w.nextMaterializedTimestamp " +
+                "from CoordinatorJobBean w "
                 + "where w.startTimestamp <= :matTime AND (w.statusStr = 'PREP' OR w.statusStr = 'RUNNING' or w.statusStr "
                 + "= 'RUNNINGWITHERROR') AND (w.nextMaterializedTimestamp < :matTime OR w.nextMaterializedTimestamp IS NULL) "
                 + "AND (w.nextMaterializedTimestamp IS NULL OR (w.endTimestamp > w.nextMaterializedTimestamp "
diff --git a/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobQueryExecutor.java b/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobQueryExecutor.java
index 432f075..c7daf91 100644
--- a/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobQueryExecutor.java
+++ b/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobQueryExecutor.java
@@ -367,7 +367,9 @@ public class CoordJobQueryExecutor extends QueryExecutor<CoordinatorJobBean, Coo
                 break;
             case GET_COORD_JOBS_OLDER_FOR_MATERIALIZATION:
                 bean = new CoordinatorJobBean();
-                bean.setId((String) ret);
+                arr = (Object[]) ret;
+                bean.setId((String) arr[0]);
+                bean.setNextMaterializedTime(DateUtils.toDate((Timestamp) arr[1]));
                 break;
             case GET_COORD_JOBS_FOR_BUNDLE_BY_APPNAME_ID:
                 bean = new CoordinatorJobBean();
diff --git a/core/src/main/java/org/apache/oozie/service/CoordMaterializeTriggerService.java b/core/src/main/java/org/apache/oozie/service/CoordMaterializeTriggerService.java
index 1376943..8f9bc20 100644
--- a/core/src/main/java/org/apache/oozie/service/CoordMaterializeTriggerService.java
+++ b/core/src/main/java/org/apache/oozie/service/CoordMaterializeTriggerService.java
@@ -181,7 +181,7 @@ public class CoordMaterializeTriggerService implements Service, Instrumentable {
                     updateList.add(new UpdateEntry<CoordJobQuery>(CoordJobQuery.UPDATE_COORD_JOB_LAST_MODIFIED_TIME,
                             coordJob));
                     Timestamp startTime = coordJob.getNextMaterializedTimestamp();
-                    if (startTime != null && startTime.getTime() > now) {
+                    if (startTime != null && startTime.getTime() < now) {
                         delayedCount ++;
                     }
                 }
diff --git a/release-log.txt b/release-log.txt
index 3f28e24..9540f82 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 5.2.0 release (trunk - unreleased)
 
+OOZIE-3393 amend Add Oozie instrumentation delayed metric in CoordMaterializeTriggerService (zuston via asalamon74)
 OOZIE-3500 Flaky tests based on WorkflowTestCase (asalamon74 via kmarton)
 OOZIE-3498 TestOozieCLI testRetryWithRetryCount and testRetryForTimeout is flaky (asalamon74 via kmarton)
 OOZIE-3483 [Java 11] Fluent job API build fails due to Jaxb2 maven plugin (kmarton via asalamon74)