You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by js...@apache.org on 2009/04/08 02:25:14 UTC

svn commit: r763052 - in /hadoop/hive/trunk: CHANGES.txt metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java

Author: jssarma
Date: Wed Apr  8 00:25:13 2009
New Revision: 763052

URL: http://svn.apache.org/viewvc?rev=763052&view=rev
Log:
HIVE-387: metastore should not use HADOOPFS variable value directly

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=763052&r1=763051&r2=763052&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Wed Apr  8 00:25:13 2009
@@ -15,6 +15,7 @@
 
   BUG FIXES
 
+    HIVE-387. Use URI from FileSystem Object instead of from HADOOPFS directly
     HIVE-381. Fix JDBC HiveResultSet's next function.
     (Kim P via namit)
 

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java?rev=763052&r1=763051&r2=763052&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java Wed Apr  8 00:25:13 2009
@@ -54,13 +54,16 @@
     }
     whRoot = new Path(whRootString);
     URI uri = whRoot.toUri();
-    // if the METASTOREWAREHOUSE value doesn't have schema and authority specified then inherit
-    // from fs.default.name in hadoop-site.xml 
-    if ((uri.getScheme() == null) && (uri.getAuthority() == null)) {
-      whRoot = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.HADOOPFS), whRootString);
-    }
+
+    // if the METASTOREWAREHOUSE value does not specify the schema and the authority
+    // then use the default file system as specified by the Configuration
     try {
-      fs  = whRoot.getFileSystem(conf);
+      if ((uri.getScheme() == null) && (uri.getAuthority() == null)) {
+        fs = FileSystem.get(conf);
+        whRoot = new Path(fs.getUri().toString(), whRootString);
+      } else {
+        fs  = whRoot.getFileSystem(conf);
+      }
     } catch (IOException e) {
       MetaStoreUtils.logAndThrowMetaException(e);
     }