You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by lo...@apache.org on 2008/09/24 19:46:01 UTC

svn commit: r698671 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java

Author: lohit
Date: Wed Sep 24 10:46:01 2008
New Revision: 698671

URL: http://svn.apache.org/viewvc?rev=698671&view=rev
Log:
HADOOP-4234. Fix KFS "glue" layer to allow applications to interface with multiple KFS metaservers. (Sriram Rao via lohit)


Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=698671&r1=698670&r2=698671&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Sep 24 10:46:01 2008
@@ -12,6 +12,9 @@
 
   BUG FIXES
 
+    HADOOP-4234. Fix KFS "glue" layer to allow applications to interface
+    with multiple KFS metaservers. (Sriram Rao via lohit)
+
 Release 0.19.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java?rev=698671&r1=698670&r2=698671&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java Wed Sep 24 10:46:01 2008
@@ -59,15 +59,21 @@
     }
 
     public void initialize(URI uri, Configuration conf) throws IOException {
-        
         try {
-            if (kfsImpl == null) {
-                kfsImpl = new KFSImpl(conf.get("fs.kfs.metaServerHost", ""),
-                                      conf.getInt("fs.kfs.metaServerPort", -1),
-                                      statistics);
-            }
+	    if (kfsImpl == null) {
+                if (uri.getHost() == null) {
+                    kfsImpl = new KFSImpl(conf.get("fs.kfs.metaServerHost", ""),
+                                          conf.getInt("fs.kfs.metaServerPort", -1),
+                                          statistics);
+                } else {
+                    kfsImpl = new KFSImpl(uri.getHost(), uri.getPort(), statistics);
+                }
+	    }
+
             this.localFs = FileSystem.getLocal(conf);
             this.uri = URI.create(uri.getScheme() + "://" + uri.getAuthority());
+            this.workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this);
+            setConf(conf);
             
         } catch (Exception e) {
             e.printStackTrace();