check for HDFS_CONF_DIR in env variables first
Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/9751513d Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/9751513d Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/9751513d Branch: refs/heads/steven/hdfs Commit: 9751513d9c70b2f26fea01a57cf3e3dee120c9ae Parents: 61fec3b Author: efikalti <[email protected]> Authored: Wed Aug 12 11:25:48 2015 +0300 Committer: efikalti <[email protected]> Committed: Wed Aug 12 11:25:48 2015 +0300 ---------------------------------------------------------------------- .../main/java/org/apache/vxquery/hdfs2/HDFSFunctions.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/vxquery/blob/9751513d/vxquery-core/src/main/java/org/apache/vxquery/hdfs2/HDFSFunctions.java ---------------------------------------------------------------------- diff --git a/vxquery-core/src/main/java/org/apache/vxquery/hdfs2/HDFSFunctions.java b/vxquery-core/src/main/java/org/apache/vxquery/hdfs2/HDFSFunctions.java index e13adf5..eb8034c 100644 --- a/vxquery-core/src/main/java/org/apache/vxquery/hdfs2/HDFSFunctions.java +++ b/vxquery-core/src/main/java/org/apache/vxquery/hdfs2/HDFSFunctions.java @@ -159,10 +159,10 @@ public class HDFSFunctions { * @return true if is successfully finds the Hadoop/HDFS home directory */ private boolean locateConf() { - + this.conf_path = System.getenv("HADOOP_CONF_DIR"); + System.out.println(conf_path); if (this.conf_path == null) { - - nodeXMLfile = new File("/home/efi/Projects/vxquery/vxquery-server/src/main/resources/conf/local.xml"); + // load properties file Properties prop = new Properties(); String propFilePath = "../vxquery-server/src/main/resources/conf/cluster.properties"; @@ -177,13 +177,15 @@ public class HDFSFunctions { } } catch (IOException e) { System.err.println(e); + return false; } // get the property value for HDFS_CONF this.conf_path = prop.getProperty("HDFS_CONF"); + System.out.println(conf_path); return this.conf_path != null; } - return false; + return this.conf_path != null; } /**
