Repository: falcon
Updated Branches:
  refs/heads/master ff2f9e27f -> 629bcfbdb


FALCON-2007 Hive DR Replication failing with - Can not create a Path from a 
null string

Following is the pull request that will check the existence of the file 
oozie.action.conf.xml. If file is not there, then it will not get into the code 
block that adds it to the configuration object, thus to avoid the exception.

Author: peeyush b <[email protected]>

Reviewers: Venkat <[email protected]>

Closes #167 from peeyushb/FALCON-2007


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

Branch: refs/heads/master
Commit: 629bcfbdbd6833cf590a6f622ccde7813e5556dd
Parents: ff2f9e2
Author: Peeyush <[email protected]>
Authored: Thu Jun 2 20:11:39 2016 +0530
Committer: peeyush b <[email protected]>
Committed: Thu Jun 2 20:11:39 2016 +0530

----------------------------------------------------------------------
 .../org/apache/falcon/hive/util/HiveDRUtils.java     | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/629bcfbd/addons/hivedr/src/main/java/org/apache/falcon/hive/util/HiveDRUtils.java
----------------------------------------------------------------------
diff --git 
a/addons/hivedr/src/main/java/org/apache/falcon/hive/util/HiveDRUtils.java 
b/addons/hivedr/src/main/java/org/apache/falcon/hive/util/HiveDRUtils.java
index d5d3bc5..b21acc7 100644
--- a/addons/hivedr/src/main/java/org/apache/falcon/hive/util/HiveDRUtils.java
+++ b/addons/hivedr/src/main/java/org/apache/falcon/hive/util/HiveDRUtils.java
@@ -70,13 +70,16 @@ public final class HiveDRUtils {
 
     public static Configuration getDefaultConf() throws IOException {
         Configuration conf = new Configuration();
-        Path confPath = new Path("file:///", 
System.getProperty("oozie.action.conf.xml"));
 
-        final boolean actionConfExists = 
confPath.getFileSystem(conf).exists(confPath);
-        LOG.info("Oozie Action conf {} found ? {}", confPath, 
actionConfExists);
-        if (actionConfExists) {
-            LOG.info("Oozie Action conf found, adding path={}, conf={}", 
confPath, conf.toString());
-            conf.addResource(confPath);
+        if (System.getProperty("oozie.action.conf.xml") != null) {
+            Path confPath = new Path("file:///", 
System.getProperty("oozie.action.conf.xml"));
+
+            final boolean actionConfExists = 
confPath.getFileSystem(conf).exists(confPath);
+            LOG.info("Oozie Action conf {} found ? {}", confPath, 
actionConfExists);
+            if (actionConfExists) {
+                LOG.info("Oozie Action conf found, adding path={}, conf={}", 
confPath, conf.toString());
+                conf.addResource(confPath);
+            }
         }
 
         String tokenFile = System.getenv("HADOOP_TOKEN_FILE_LOCATION");

Reply via email to