Repository: falcon Updated Branches: refs/heads/0.10 da3e37b25 -> ca90089e3
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 (cherry picked from commit 629bcfbdbd6833cf590a6f622ccde7813e5556dd) Signed-off-by: peeyush b <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/ca90089e Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/ca90089e Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/ca90089e Branch: refs/heads/0.10 Commit: ca90089e3a7752799429005449bd0f6d2e04a0c1 Parents: da3e37b Author: Peeyush <[email protected]> Authored: Thu Jun 2 20:11:39 2016 +0530 Committer: peeyush b <[email protected]> Committed: Thu Jun 2 20:12:00 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/ca90089e/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");
