You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by sh...@apache.org on 2016/11/15 09:50:57 UTC

[1/2] oozie git commit: OOZIE-2724 coord:current resolves monthly/yearly dependencies incorrectly (satishsaley via shwethags)

Repository: oozie
Updated Branches:
  refs/heads/master ca01c2836 -> 86009e9da


OOZIE-2724 coord:current resolves monthly/yearly dependencies incorrectly (satishsaley via shwethags)


Project: http://git-wip-us.apache.org/repos/asf/oozie/repo
Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/7cebc260
Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/7cebc260
Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/7cebc260

Branch: refs/heads/master
Commit: 7cebc2604d6813fd1e2929a1b8334a8ba8df4cf8
Parents: ca01c28
Author: Shwetha GS <ss...@hortonworks.com>
Authored: Tue Nov 15 15:19:06 2016 +0530
Committer: Shwetha GS <ss...@hortonworks.com>
Committed: Tue Nov 15 15:19:06 2016 +0530

----------------------------------------------------------------------
 .../apache/oozie/coord/CoordELFunctions.java    |  7 ++--
 .../oozie/coord/TestCoordELFunctions.java       | 36 ++++++++++++++++++++
 release-log.txt                                 |  1 +
 3 files changed, 40 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oozie/blob/7cebc260/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java b/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
index 22eb1c3..925a7aa 100644
--- a/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
+++ b/core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
@@ -62,8 +62,6 @@ public class CoordELFunctions {
     public static final long MINUTE_MSEC = 60 * 1000L;
     public static final long HOUR_MSEC = 60 * MINUTE_MSEC;
     public static final long DAY_MSEC = 24 * HOUR_MSEC;
-    public static final long MONTH_MSEC = 30 * DAY_MSEC;
-    public static final long YEAR_MSEC = 365 * DAY_MSEC;
     /**
      * Used in defining the frequency in 'day' unit. <p> domain: <code> val &gt; 0</code> and should be integer.
      *
@@ -1401,10 +1399,11 @@ public class CoordELFunctions {
                 break;
             case MONTH:
             case END_OF_MONTH:
-                instanceCount[0] = (int) ((effectiveTime.getTime() - datasetInitialInstance.getTime()) / MONTH_MSEC);
+                int diffYear = calEffectiveTime.get(Calendar.YEAR) - current.get(Calendar.YEAR);
+                instanceCount[0] = diffYear * 12 + calEffectiveTime.get(Calendar.MONTH) - current.get(Calendar.MONTH);
                 break;
             case YEAR:
-                instanceCount[0] = (int) ((effectiveTime.getTime() - datasetInitialInstance.getTime()) / YEAR_MSEC);
+                instanceCount[0] = calEffectiveTime.get(Calendar.YEAR) - current.get(Calendar.YEAR);
                 break;
             default:
                 throw new IllegalArgumentException("Unhandled dataset time unit " + dsTimeUnit);

http://git-wip-us.apache.org/repos/asf/oozie/blob/7cebc260/core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java b/core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java
index fb7e030..be60133 100644
--- a/core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java
+++ b/core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java
@@ -702,6 +702,42 @@ public class TestCoordELFunctions extends XTestCase {
 
         expr = "${coord:current(1)}";
         assertEquals("2009-06-01T07:00Z", CoordELFunctions.evalAndWrap(eval, expr));
+
+        // Case 8
+        ds.setEndOfDuration(TimeUnit.END_OF_MONTH);
+        ds.setFrequency(1);
+        ds.setTimeZone(DateUtils.getTimeZone("UTC"));
+        ds.setInitInstance(DateUtils.parseDateOozieTZ("2010-01-01T00:00Z"));
+        appInst.setNominalTime(DateUtils.parseDateOozieTZ("2016-10-31T00:55Z"));
+        CoordELFunctions.configureEvaluator(eval, ds, appInst);
+
+        expr = "${coord:current(0)}";
+        assertEquals("2016-10-01T00:00Z", CoordELFunctions.evalAndWrap(eval, expr));
+
+        expr = "${coord:current(1)}";
+        assertEquals("2016-11-01T00:00Z", CoordELFunctions.evalAndWrap(eval, expr));
+
+        expr = "${coord:current(-1)}";
+        assertEquals("2016-09-01T00:00Z", CoordELFunctions.evalAndWrap(eval, expr));
+
+        // Test with YEAR
+        ds.setTimeUnit(TimeUnit.YEAR);
+        ds.setEndOfDuration(TimeUnit.YEAR);
+        ds.setFrequency(1);
+        ds.setTimeZone(DateUtils.getTimeZone("UTC"));
+        // Initial instance is far behind to accumulate effect of leap years
+        ds.setInitInstance(DateUtils.parseDateOozieTZ("1963-01-01T00:00Z"));
+        appInst.setNominalTime(DateUtils.parseDateOozieTZ("2016-10-31T00:55Z"));
+        CoordELFunctions.configureEvaluator(eval, ds, appInst);
+
+        expr = "${coord:current(0)}";
+        assertEquals("2016-01-01T00:00Z", CoordELFunctions.evalAndWrap(eval, expr));
+
+        expr = "${coord:current(1)}";
+        assertEquals("2017-01-01T00:00Z", CoordELFunctions.evalAndWrap(eval, expr));
+
+        expr = "${coord:current(-1)}";
+        assertEquals("2015-01-01T00:00Z", CoordELFunctions.evalAndWrap(eval, expr));
     }
 
     public void testOffset() throws Exception {

http://git-wip-us.apache.org/repos/asf/oozie/blob/7cebc260/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 3071c7b..fead396 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -10,6 +10,7 @@ OOZIE-2634 Queue dump command message is confusing when the queue is empty (andr
 
 -- Oozie 4.3.0 release
 
+OOZIE-2724 coord:current resolves monthly/yearly dependencies incorrectly (satishsaley via shwethags)
 OOZIE-2719 Test case failure (abhishekbafna via jaydeepvishwakarma)
 OOZIE-2674 Improve oozie commads documentation (abhishekbafna via rkanter)
 OOZIE-2710 Oozie HCatalog example workflow fails (abhishekbafna via shwethags)


[2/2] oozie git commit: OOZIE-2725 Upgrade Tomcat to 6.0.47 for the latest security fixes (rkanter via shwethags)

Posted by sh...@apache.org.
OOZIE-2725 Upgrade Tomcat to 6.0.47 for the latest security fixes (rkanter via shwethags)


Project: http://git-wip-us.apache.org/repos/asf/oozie/repo
Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/86009e9d
Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/86009e9d
Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/86009e9d

Branch: refs/heads/master
Commit: 86009e9dac6cfea86684c0aa6d3c324af986390e
Parents: 7cebc26
Author: Shwetha GS <ss...@hortonworks.com>
Authored: Tue Nov 15 15:20:41 2016 +0530
Committer: Shwetha GS <ss...@hortonworks.com>
Committed: Tue Nov 15 15:20:41 2016 +0530

----------------------------------------------------------------------
 docs/src/site/twiki/DG_QuickStart.twiki | 2 +-
 docs/src/site/twiki/ENG_Building.twiki  | 2 +-
 pom.xml                                 | 4 ++--
 release-log.txt                         | 1 +
 4 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oozie/blob/86009e9d/docs/src/site/twiki/DG_QuickStart.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/DG_QuickStart.twiki b/docs/src/site/twiki/DG_QuickStart.twiki
index 1eb02a9..6dec179 100644
--- a/docs/src/site/twiki/DG_QuickStart.twiki
+++ b/docs/src/site/twiki/DG_QuickStart.twiki
@@ -50,7 +50,7 @@ profile depending on the hadoop version used.
 -Dpig.classifier=<classifier> - default none
 -Dsqoop.version=<version> - default 1.4.3
 -Dsqoop.classifier=<classifier> - default hadoop100
--Dtomcat.version=<version> - default 6.0.41
+-Dtomcat.version=<version> - default 6.0.47
 -Dopenjpa.version=<version> - default 2.2.2
 -Dxerces.version=<version> - default 2.10.0
 -Dcurator.version=<version> - default 2.5.0

http://git-wip-us.apache.org/repos/asf/oozie/blob/86009e9d/docs/src/site/twiki/ENG_Building.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/ENG_Building.twiki b/docs/src/site/twiki/ENG_Building.twiki
index 3560a9b..0766976 100644
--- a/docs/src/site/twiki/ENG_Building.twiki
+++ b/docs/src/site/twiki/ENG_Building.twiki
@@ -221,7 +221,7 @@ profile depending on the hadoop version used.
 -Dpig.classifier=<classifier> - default none
 -Dsqoop.version=<version> - default 1.4.3
 -Dsqoop.classifier=<classifier> - default hadoop100
--Dtomcat.version=<version> - default 6.0.41
+-Dtomcat.version=<version> - default 6.0.47
 -Dopenjpa.version=<version> - default 2.2.2
 -Dxerces.version=<version> - default 2.10.0
 -Dcurator.version=<version> - default 2.5.0

http://git-wip-us.apache.org/repos/asf/oozie/blob/86009e9d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c9a19de..acedc6e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,8 +107,8 @@
 
          <jetty.version>9.2.19.v20160908</jetty.version>
 
-        <!-- Tomcat version -->
-         <tomcat.version>6.0.44</tomcat.version>
+         <!-- Tomcat version -->
+         <tomcat.version>6.0.47</tomcat.version>
          <jline.version>0.9.94</jline.version>
          <openjpa.version>2.4.1</openjpa.version>
          <xerces.version>2.10.0</xerces.version>

http://git-wip-us.apache.org/repos/asf/oozie/blob/86009e9d/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index fead396..9dd6adb 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -10,6 +10,7 @@ OOZIE-2634 Queue dump command message is confusing when the queue is empty (andr
 
 -- Oozie 4.3.0 release
 
+OOZIE-2725 Upgrade Tomcat to 6.0.47 for the latest security fixes (rkanter via shwethags)
 OOZIE-2724 coord:current resolves monthly/yearly dependencies incorrectly (satishsaley via shwethags)
 OOZIE-2719 Test case failure (abhishekbafna via jaydeepvishwakarma)
 OOZIE-2674 Improve oozie commads documentation (abhishekbafna via rkanter)