oozie git commit: OOZIE-3078 PasswordMasker throws NPE with null arguments (asasvari)

2017-10-09 Thread asasvari
Repository: oozie
Updated Branches:
  refs/heads/master 7bda35784 -> be293c046


OOZIE-3078 PasswordMasker throws NPE with null arguments (asasvari)


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

Branch: refs/heads/master
Commit: be293c046d7d83765c65140921c3de5ca3d7b55a
Parents: 7bda357
Author: Attila Sasvari 
Authored: Mon Oct 9 16:55:44 2017 +0200
Committer: Attila Sasvari 
Committed: Mon Oct 9 16:55:44 2017 +0200

--
 release-log.txt   |  1 +
 .../org/apache/oozie/action/hadoop/PasswordMasker.java| 10 ++
 .../apache/oozie/action/hadoop/TestPasswordMasker.java| 10 ++
 3 files changed, 17 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/oozie/blob/be293c04/release-log.txt
--
diff --git a/release-log.txt b/release-log.txt
index 600a732..13d3a97 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 5.0.0 release (trunk - unreleased)
 
+OOZIE-3078 PasswordMasker throws NPE with null arguments (asasvari)
 OOZIE-3075 Follow-up on OOZIE-3054: create the lib directory if it doesn't 
exist (pbacsko)
 OOZIE-3072 oozie.service.HadoopAccessorService.action.configurations   should 
overwrite default values set in Hadoop's configuration files (gezapeti)
 OOZIE-2963 Use net.hydromatic instead of org.pentaho aggdesigner-algorithmin 
pomfilesi (dbist13 via gezapeti)

http://git-wip-us.apache.org/repos/asf/oozie/blob/be293c04/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PasswordMasker.java
--
diff --git 
a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PasswordMasker.java
 
b/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PasswordMasker.java
index fd265e8..b5f7a86 100644
--- 
a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PasswordMasker.java
+++ 
b/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/PasswordMasker.java
@@ -25,8 +25,6 @@ import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 /**
  * A generic password masker that masks {@code Map} values 
given that its keys are considered password keys.
  * 
@@ -116,8 +114,9 @@ public class PasswordMasker {
  * @return The value of the entry changed based on the replace algorithm 
described above
  */
 private String mask(String key, String value) {
-checkNotNull(key, "key has to be set");
-checkNotNull(value, "value has to be set");
+if (key == null || value == null || value.isEmpty()) {
+return value;
+}
 
 if (isPasswordKey(key)) {
 return PASSWORD_MASK;
@@ -147,6 +146,9 @@ public class PasswordMasker {
 }
 
 private boolean containsPasswordFragment(String maybePasswordFragments) {
+if (maybePasswordFragments == null || maybePasswordFragments.length() 
== 0) {
+return false;
+}
 return PASSWORD_CONTAINING_PATTERN
 .matcher(maybePasswordFragments)
 .matches();

http://git-wip-us.apache.org/repos/asf/oozie/blob/be293c04/sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestPasswordMasker.java
--
diff --git 
a/sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestPasswordMasker.java
 
b/sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestPasswordMasker.java
index 08e55e1..e362759 100644
--- 
a/sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestPasswordMasker.java
+++ 
b/sharelib/oozie/src/test/java/org/apache/oozie/action/hadoop/TestPasswordMasker.java
@@ -102,6 +102,16 @@ public class TestPasswordMasker {
 passwordMasker.maskPasswordsIfNecessary("aa 
-Djava.sysprop.password=1234 bb DUMMY_PASSWORD=dummy cc"));
 }
 
+@Test
+public void testMaskNullArgument() {
+assertEquals(null, passwordMasker.maskPasswordsIfNecessary(null));
+}
+
+@Test
+public void testMaskEmptyArgument() {
+assertEquals("", passwordMasker.maskPasswordsIfNecessary(""));
+}
+
 @SuppressWarnings("unchecked")
 private Map jsonToMap(String jsonPath) throws IOException {
 return new 
ObjectMapper().readValue(getClass().getResourceAsStream(jsonPath), 
HashMap.class);



oozie git commit: OOZIE-3079 Filtering coordinators returns bundle id as null (satishsaley)

2017-10-09 Thread satishsaley
Repository: oozie
Updated Branches:
  refs/heads/master be293c046 -> 660b3151c


OOZIE-3079 Filtering coordinators returns bundle id as null (satishsaley)


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

Branch: refs/heads/master
Commit: 660b3151ce1b808e922d708f14b460a715fa6a33
Parents: be293c0
Author: satishsaley 
Authored: Mon Oct 9 09:57:37 2017 -0700
Committer: satishsaley 
Committed: Mon Oct 9 09:57:37 2017 -0700

--
 .../org/apache/oozie/CoordinatorJobBean.java |  5 -
 .../executor/jpa/CoordJobInfoGetJPAExecutor.java |  3 +++
 .../apache/oozie/store/StoreStatusFilter.java|  2 +-
 .../jpa/TestCoordJobInfoGetJPAExecutor.java  | 19 +++
 release-log.txt  |  1 +
 5 files changed, 28 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/oozie/blob/660b3151/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java
--
diff --git a/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java 
b/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java
index 3a3120d..7dda508 100644
--- a/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java
+++ b/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java
@@ -108,7 +108,10 @@ import org.json.simple.JSONObject;
 
 @NamedQuery(name = "GET_COORD_JOBS_COUNT", query = "select count(w) 
from CoordinatorJobBean w"),
 
-@NamedQuery(name = "GET_COORD_JOBS_COLUMNS", query = "select w.id, 
w.appName, w.statusStr, w.user, w.group, w.startTimestamp, w.endTimestamp, 
w.appPath, w.concurrency, w.frequency, w.lastActionTimestamp, 
w.nextMaterializedTimestamp, w.createdTimestamp, w.timeUnitStr, w.timeZone, 
w.timeOut from CoordinatorJobBean w order by w.createdTimestamp desc"),
+@NamedQuery(name = "GET_COORD_JOBS_COLUMNS", query = "select w.id, 
w.appName, w.statusStr, w.user, w.group, "
++ "w.startTimestamp, w.endTimestamp, w.appPath, w.concurrency, 
w.frequency, w.lastActionTimestamp, "
++ "w.nextMaterializedTimestamp, w.createdTimestamp, 
w.timeUnitStr, w.timeZone, w.timeOut, w.bundleId "
++ "from CoordinatorJobBean w order by w.createdTimestamp 
desc"),
 
 //TODO need to remove.
 @NamedQuery(name = "GET_COORD_JOBS_OLDER_THAN", query = "select 
OBJECT(w) 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 AND (w.pauseTimestamp IS NULL 
OR w.pauseTimestamp > w.nextMaterializedTimestamp))) order by 
w.lastModifiedTimestamp"),

http://git-wip-us.apache.org/repos/asf/oozie/blob/660b3151/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobInfoGetJPAExecutor.java
--
diff --git 
a/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobInfoGetJPAExecutor.java
 
b/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobInfoGetJPAExecutor.java
index 8ae070e..4c641d7 100644
--- 
a/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobInfoGetJPAExecutor.java
+++ 
b/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobInfoGetJPAExecutor.java
@@ -168,6 +168,9 @@ public class CoordJobInfoGetJPAExecutor implements 
JPAExecutorhttp://git-wip-us.apache.org/repos/asf/oozie/blob/660b3151/core/src/main/java/org/apache/oozie/store/StoreStatusFilter.java
--
diff --git a/core/src/main/java/org/apache/oozie/store/StoreStatusFilter.java 
b/core/src/main/java/org/apache/oozie/store/StoreStatusFilter.java
index 0850b75..cba75df 100644
--- a/core/src/main/java/org/apache/oozie/store/StoreStatusFilter.java
+++ b/core/src/main/java/org/apache/oozie/store/StoreStatusFilter.java
@@ -32,7 +32,7 @@ import org.apache.oozie.util.XLog;
 public class StoreStatusFilter {
 public static final String coordSeletStr = "Select w.id, w.appName, 
w.statusStr, w.user, w.group, w.startTimestamp, " +
 "w.endTimestamp, w.appPath, w.concurrency, w.frequency, 
w.lastActionTimestamp, w.nextMaterializedTimestamp, " +
-"w.createdTimestamp, w.timeUnitStr, w.timeZone, w.timeOut from 
CoordinatorJobBean w";
+"w.createdTimestamp, w.timeUnitStr, w.timeZone, w.timeOut, 
w.bundleId from CoordinatorJobBean w";
 
 public static final String coordCountStr = "Select count(w) from 
Coordinato

oozie git commit: OOZIE-3031 Coord job with only unresolved dependencies doesn't timeout (puru via satishsaley)

2017-10-09 Thread satishsaley
Repository: oozie
Updated Branches:
  refs/heads/master 660b3151c -> 0a6f83e62


OOZIE-3031 Coord job with only unresolved dependencies doesn't timeout (puru 
via satishsaley)


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

Branch: refs/heads/master
Commit: 0a6f83e62126c60f9f9f2648368ed8bcf6293876
Parents: 660b315
Author: satishsaley 
Authored: Mon Oct 9 15:01:30 2017 -0700
Committer: satishsaley 
Committed: Mon Oct 9 15:01:30 2017 -0700

--
 .../coord/CoordActionInputCheckXCommand.java   |  3 +--
 .../coord/TestCoordActionInputCheckXCommand.java   | 17 +
 release-log.txt|  1 +
 3 files changed, 19 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/oozie/blob/0a6f83e6/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
--
diff --git 
a/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
 
b/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
index 401b2c7..179cc45 100644
--- 
a/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
+++ 
b/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
@@ -172,7 +172,6 @@ public class CoordActionInputCheckXCommand extends 
CoordinatorXCommand {
 
 
 boolean status = checkResolvedInput(actionXml, existList, 
nonExistList, actionConf);
-String nonExistListStr = nonExistList.toString();
 boolean isPushDependenciesMet = 
coordPushInputDependency.isDependencyMet();
 if (status && nonResolvedList.length() > 0) {
 status = (isPushDependenciesMet) ? 
checkUnResolvedInput(actionXml, actionConf) : false;
@@ -196,7 +195,7 @@ public class CoordActionInputCheckXCommand extends 
CoordinatorXCommand {
 updateCoordAction(coordAction, isChangeInDependency);
 }
 else {
-if (!nonExistListStr.isEmpty() && isPushDependenciesMet) {
+if (isPushDependenciesMet) {
 queue(new CoordActionTimeOutXCommand(coordAction, 
coordJob.getUser(), coordJob.getAppName()));
 }
 else {

http://git-wip-us.apache.org/repos/asf/oozie/blob/0a6f83e6/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
--
diff --git 
a/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
 
b/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
index 9f20942..96ac195 100644
--- 
a/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
+++ 
b/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
@@ -755,6 +755,23 @@ public class TestCoordActionInputCheckXCommand extends 
XDataTestCase {
 }
 
 @Test
+public void testTimeoutWithUnResolved() throws Exception {
+String jobId = "000-" + new Date().getTime() + 
"-TestCoordActionInputCheckXCommand-C";
+Date startTime = DateUtils.parseDateOozieTZ("2009-02-15T23:59" + TZ);
+Date endTime = DateUtils.parseDateOozieTZ("2009-02-16T23:59" + TZ);
+CoordinatorJobBean job = addRecordToCoordJobTable(jobId, startTime, 
endTime, "latest");
+new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
+CoordinatorActionBean action = CoordActionQueryExecutor.getInstance()
+.get(CoordActionQuery.GET_COORD_ACTION, job.getId() + "@1");
+assertEquals(CoordCommandUtils.RESOLVED_UNRESOLVED_SEPARATOR + 
"${coord:latestRange(-3,0)}",
+action.getMissingDependencies());
+long timeOutCreationTime = System.currentTimeMillis() - (13 * 60 * 
1000);
+setCoordActionCreationTime(action.getId(), timeOutCreationTime);
+new CoordActionInputCheckXCommand(action.getId(), 
action.getJobId()).call();
+checkCoordActionStatus(action.getId(),  
CoordinatorAction.Status.TIMEDOUT);
+}
+
+@Test
 public void testTimeoutWithException() throws Exception {
 String missingDeps = "nofs:///dirx/filex";
 String actionId = addInitRecords(missingDeps, null, TZ);

http://git-wip-us.apache.org/repos/asf/oozie/blob/0a6f83e6/release-log.txt
--
diff --git a/release-log.txt b/release-log.txt
index 3358149..f126e64 100644
--- a/release-log.txt
+++ b