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 sz...@apache.org on 2009/02/11 22:22:57 UTC

svn commit: r743513 - in /hadoop/core/trunk: ./ src/contrib/streaming/src/test/org/apache/hadoop/streaming/ src/core/org/apache/hadoop/filecache/ src/core/org/apache/hadoop/fs/ src/core/org/apache/hadoop/fs/kfs/ src/core/org/apache/hadoop/fs/s3/ src/hd...

Author: szetszwo
Date: Wed Feb 11 21:22:55 2009
New Revision: 743513

URL: http://svn.apache.org/viewvc?rev=743513&view=rev
Log:
HADOOP-4942. Remove deprecated FileSystem methods getName() and getNamed(..).  (Jakob Homan via szetszwo)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestMultipleCachefiles.java
    hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestSymLink.java
    hadoop/core/trunk/src/core/org/apache/hadoop/filecache/DistributedCache.java
    hadoop/core/trunk/src/core/org/apache/hadoop/fs/FileSystem.java
    hadoop/core/trunk/src/core/org/apache/hadoop/fs/FilterFileSystem.java
    hadoop/core/trunk/src/core/org/apache/hadoop/fs/kfs/KosmosFileSystem.java
    hadoop/core/trunk/src/core/org/apache/hadoop/fs/s3/S3FileSystem.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/HadoopTestCase.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRClasspath.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestSpecialCharactersInOutputPath.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/pipes/TestPipes.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Feb 11 21:22:55 2009
@@ -23,6 +23,9 @@
     HADOOP-5094. Show hostname and separate live/dead datanodes in DFSAdmin
     report.  (Jakob Homan via szetszwo)
 
+    HADOOP-4942. Remove deprecated FileSystem methods getName() and
+    getNamed(String name, Configuration conf).  (Jakob Homan via szetszwo)
+
   NEW FEATURES
 
     HADOOP-4268. Change fsck to use ClientProtocol methods so that the

Modified: hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestMultipleCachefiles.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestMultipleCachefiles.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestMultipleCachefiles.java (original)
+++ hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestMultipleCachefiles.java Wed Feb 11 21:22:55 2009
@@ -67,7 +67,8 @@
         Configuration conf = new Configuration();
         dfs = new MiniDFSCluster(conf, 1, true, null);
         FileSystem fileSys = dfs.getFileSystem();
-        String namenode = fileSys.getName();
+        String namenode = fileSys.getUri().toString();
+
         mr  = new MiniMRCluster(1, namenode, 3);
         // During tests, the default Configuration will use a local mapred
         // So don't specify -config or -cluster
@@ -86,8 +87,8 @@
           "-jobconf", "mapred.child.java.opts=-Dcontrib.name=" + System.getProperty("contrib.name") + " " +
                       "-Dbuild.test=" + System.getProperty("build.test") + " " +
                       conf.get("mapred.child.java.opts",""),
-          "-cacheFile", "hdfs://"+fileSys.getName()+CACHE_FILE + "#" + mapString,
-          "-cacheFile", "hdfs://"+fileSys.getName()+CACHE_FILE_2 + "#" + mapString2
+          "-cacheFile", fileSys.getUri() + CACHE_FILE + "#" + mapString,
+          "-cacheFile", fileSys.getUri() + CACHE_FILE_2 + "#" + mapString2
         };
 
         fileSys.delete(new Path(OUTPUT_DIR), true);

Modified: hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestSymLink.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestSymLink.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestSymLink.java (original)
+++ hadoop/core/trunk/src/contrib/streaming/src/test/org/apache/hadoop/streaming/TestSymLink.java Wed Feb 11 21:22:55 2009
@@ -64,7 +64,7 @@
         Configuration conf = new Configuration();
         dfs = new MiniDFSCluster(conf, 1, true, null);
         FileSystem fileSys = dfs.getFileSystem();
-        String namenode = fileSys.getName();
+        String namenode = fileSys.getUri().toString();
         mr  = new MiniMRCluster(1, namenode, 3);
         // During tests, the default Configuration will use a local mapred
         // So don't specify -config or -cluster
@@ -83,7 +83,7 @@
           "-jobconf", "mapred.child.java.opts=-Dcontrib.name=" + System.getProperty("contrib.name") + " " +
                       "-Dbuild.test=" + System.getProperty("build.test") + " " +
                       conf.get("mapred.child.java.opts",""),
-          "-cacheFile", "hdfs://"+fileSys.getName()+CACHE_FILE + "#testlink"
+          "-cacheFile", fileSys.getUri() + CACHE_FILE + "#testlink"
         };
 
         fileSys.delete(new Path(OUTPUT_DIR), true);

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/filecache/DistributedCache.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/filecache/DistributedCache.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/filecache/DistributedCache.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/filecache/DistributedCache.java Wed Feb 11 21:22:55 2009
@@ -498,22 +498,10 @@
     }  
   }
   
-  private static String getFileSysName(URI url) {
-    String fsname = url.getScheme();
-    if ("hdfs".equals(fsname)) {
-      String host = url.getHost();
-      int port = url.getPort();
-      return (port == (-1)) ? host : (host + ":" + port);
-    } else {
-      return null;
-    }
-  }
-  
   private static FileSystem getFileSystem(URI cache, Configuration conf)
     throws IOException {
-    String fileSysName = getFileSysName(cache);
-    if (fileSysName != null)
-      return FileSystem.getNamed(fileSysName, conf);
+    if ("hdfs".equals(cache.getScheme()))
+      return FileSystem.get(cache, conf);
     else
       return FileSystem.get(conf);
   }

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/fs/FileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/fs/FileSystem.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/fs/FileSystem.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/fs/FileSystem.java Wed Feb 11 21:22:55 2009
@@ -134,15 +134,6 @@
   /** Returns a URI whose scheme and authority identify this FileSystem.*/
   public abstract URI getUri();
   
-  /** @deprecated call #getUri() instead.*/
-  public String getName() { return getUri().toString(); }
-
-  /** @deprecated call #get(URI,Configuration) instead. */
-  public static FileSystem getNamed(String name, Configuration conf)
-    throws IOException {
-    return get(URI.create(fixName(name)), conf);
-  }
-
   /** Update old-format filesystem names, for back-compatibility.  This should
    * eventually be replaced with a checkName() method that throws an exception
    * for old-format names. */ 

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/fs/FilterFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/fs/FilterFileSystem.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/fs/FilterFileSystem.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/fs/FilterFileSystem.java Wed Feb 11 21:22:55 2009
@@ -69,11 +69,6 @@
     return fs.getUri();
   }
 
-  /** @deprecated call #getUri() instead.*/
-  public String getName() {
-    return fs.getName();
-  }
-
   /** Make sure that a path specifies a FileSystem. */
   public Path makeQualified(Path path) {
     return fs.makeQualified(path);

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=743513&r1=743512&r2=743513&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 Feb 11 21:22:55 2009
@@ -86,12 +86,6 @@
     }
 
     @Override
-    @Deprecated
-    public String getName() {
-	return getUri().toString();
-    }
-
-    @Override
     public Path getWorkingDirectory() {
 	return workingDir;
     }

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/fs/s3/S3FileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/fs/s3/S3FileSystem.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/fs/s3/S3FileSystem.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/fs/s3/S3FileSystem.java Wed Feb 11 21:22:55 2009
@@ -100,11 +100,6 @@
     return (FileSystemStore) RetryProxy.create(FileSystemStore.class,
                                                store, methodNameToPolicyMap);
   }
-  
-  @Override
-  public String getName() {
-    return getUri().toString();
-  }
 
   @Override
   public Path getWorkingDirectory() {

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java Wed Feb 11 21:22:55 2009
@@ -64,11 +64,10 @@
     initialize(NameNode.getUri(namenode), conf);
   }
 
-  /** @deprecated */
-  public String getName() { return uri.getAuthority(); }
-
+  @Override
   public URI getUri() { return uri; }
 
+  @Override
   public void initialize(URI uri, Configuration conf) throws IOException {
     setConf(conf);
 
@@ -84,6 +83,7 @@
   }
 
   /** Permit paths which explicitly specify the default port. */
+  @Override
   protected void checkPath(Path path) {
     URI thisUri = this.getUri();
     URI thatUri = path.toUri();
@@ -99,6 +99,7 @@
   }
 
   /** Normalize paths that explicitly specify the default port. */
+  @Override
   public Path makeQualified(Path path) {
     URI thisUri = this.getUri();
     URI thatUri = path.toUri();
@@ -115,15 +116,17 @@
     return super.makeQualified(path);
   }
 
-
+  @Override
   public Path getWorkingDirectory() {
     return workingDir;
   }
 
+  @Override
   public long getDefaultBlockSize() {
     return dfs.getDefaultBlockSize();
   }
 
+  @Override
   public short getDefaultReplication() {
     return dfs.getDefaultReplication();
   }
@@ -136,6 +139,7 @@
     }
   }
 
+  @Override
   public void setWorkingDirectory(Path dir) {
     String result = makeAbsolute(dir).toUri().getPath();
     if (!DFSUtil.isValidName(result)) {
@@ -146,6 +150,7 @@
   }
 
   /** {@inheritDoc} */
+  @Override
   public Path getHomeDirectory() {
     return new Path("/user/" + dfs.ugi.getUserName()).makeQualified(this);
   }
@@ -160,7 +165,7 @@
     return result;
   }
   
-
+  @Override
   public BlockLocation[] getFileBlockLocations(FileStatus file, long start,
       long len) throws IOException {
     if (file == null) {
@@ -169,16 +174,19 @@
     return dfs.getBlockLocations(getPathName(file.getPath()), start, len);
   }
 
+  @Override
   public void setVerifyChecksum(boolean verifyChecksum) {
     this.verifyChecksum = verifyChecksum;
   }
 
+  @Override
   public FSDataInputStream open(Path f, int bufferSize) throws IOException {
     return new DFSClient.DFSDataInputStream(
           dfs.open(getPathName(f), bufferSize, verifyChecksum, statistics));
   }
 
   /** This optional operation is not yet supported. */
+  @Override
   public FSDataOutputStream append(Path f, int bufferSize,
       Progressable progress) throws IOException {
 
@@ -186,6 +194,7 @@
     return new FSDataOutputStream(op, statistics, op.getInitialLen());
   }
 
+  @Override
   public FSDataOutputStream create(Path f, FsPermission permission,
     boolean overwrite,
     int bufferSize, short replication, long blockSize,
@@ -197,6 +206,7 @@
         statistics);
   }
 
+  @Override
   public boolean setReplication(Path src, 
                                 short replication
                                ) throws IOException {
@@ -206,6 +216,7 @@
   /**
    * Rename files/dirs
    */
+  @Override
   public boolean rename(Path src, Path dst) throws IOException {
     return dfs.rename(getPathName(src), getPathName(dst));
   }
@@ -214,11 +225,13 @@
    * requires a boolean check to delete a non 
    * empty directory recursively.
    */
+  @Override
   public boolean delete(Path f, boolean recursive) throws IOException {
    return dfs.delete(getPathName(f), recursive);
   }
   
   /** {@inheritDoc} */
+  @Override
   public ContentSummary getContentSummary(Path f) throws IOException {
     return dfs.getContentSummary(getPathName(f));
   }
@@ -239,6 +252,7 @@
         f.getPath().makeQualified(this)); // fully-qualify path
   }
 
+  @Override
   public FileStatus[] listStatus(Path p) throws IOException {
     FileStatus[] infos = dfs.listPaths(getPathName(p));
     if (infos == null) return null;
@@ -249,11 +263,13 @@
     return stats;
   }
 
+  @Override
   public boolean mkdirs(Path f, FsPermission permission) throws IOException {
     return dfs.mkdirs(getPathName(f), permission);
   }
 
   /** {@inheritDoc} */
+  @Override
   public void close() throws IOException {
     try {
       super.processDeleteOnExit();
@@ -263,6 +279,7 @@
     }
   }
 
+  @Override
   public String toString() {
     return "DFS[" + dfs + "]";
   }
@@ -288,6 +305,7 @@
   }
   
   /** {@inheritDoc} */
+  @Override
   public FsStatus getStatus(Path p) throws IOException {
     return dfs.getDiskStatus();
   }
@@ -420,6 +438,7 @@
    * Returns the stat information about the file.
    * @throws FileNotFoundException if the file does not exist.
    */
+  @Override
   public FileStatus getFileStatus(Path f) throws IOException {
     FileStatus fi = dfs.getFileInfo(getPathName(f));
     if (fi != null) {
@@ -430,17 +449,20 @@
   }
 
   /** {@inheritDoc} */
+  @Override
   public MD5MD5CRC32FileChecksum getFileChecksum(Path f) throws IOException {
     return dfs.getFileChecksum(getPathName(f));
   }
 
   /** {@inheritDoc }*/
+  @Override
   public void setPermission(Path p, FsPermission permission
       ) throws IOException {
     dfs.setPermission(getPathName(p), permission);
   }
 
   /** {@inheritDoc }*/
+  @Override
   public void setOwner(Path p, String username, String groupname
       ) throws IOException {
     if (username == null && groupname == null) {
@@ -450,6 +472,7 @@
   }
 
   /** {@inheritDoc }*/
+  @Override
   public void setTimes(Path p, long mtime, long atime
       ) throws IOException {
     dfs.setTimes(getPathName(p), mtime, atime);

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java Wed Feb 11 21:22:55 2009
@@ -82,7 +82,7 @@
 
       ConfigurableMiniMRCluster.setConfiguration(props);
       //noinspection deprecation
-      mrCluster = new ConfigurableMiniMRCluster(2, getFileSystem().getName(), 1);
+      mrCluster = new ConfigurableMiniMRCluster(2, getFileSystem().getUri().toString(), 1);
     }
   }
 

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/HadoopTestCase.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/HadoopTestCase.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/HadoopTestCase.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/HadoopTestCase.java Wed Feb 11 21:22:55 2009
@@ -152,7 +152,7 @@
     }
     else {
       //noinspection deprecation
-      mrCluster = new MiniMRCluster(taskTrackers, fileSystem.getName(), 1);
+      mrCluster = new MiniMRCluster(taskTrackers, fileSystem.getUri().toString(), 1);
     }
   }
 

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestEmptyJobWithDFS.java Wed Feb 11 21:22:55 2009
@@ -19,6 +19,7 @@
 package org.apache.hadoop.mapred;
 
 import java.io.IOException;
+import java.net.URI;
 
 import junit.framework.TestCase;
 
@@ -51,7 +52,7 @@
    * @return true if the MR job is successful, otherwise false
    * @throws IOException
    */
-  public static boolean launchEmptyJob(String fileSys,
+  public static boolean launchEmptyJob(URI fileSys,
                                        String jobTracker,
                                        JobConf conf,
                                        int numMaps,
@@ -59,7 +60,7 @@
     // create an empty input dir
     final Path inDir = new Path("/testing/empty/input");
     final Path outDir = new Path("/testing/empty/output");
-    FileSystem fs = FileSystem.getNamed(fileSys, conf);
+    FileSystem fs = FileSystem.get(fileSys, conf);
     fs.delete(outDir, true);
     if (!fs.mkdirs(inDir)) {
       LOG.warn("Can't create " + inDir);
@@ -122,12 +123,12 @@
       Configuration conf = new Configuration();
       dfs = new MiniDFSCluster(conf, 1, true, null);
       fileSys = dfs.getFileSystem();
-      namenode = fileSys.getName();
+      namenode = fileSys.getUri().toString();
       mr = new MiniMRCluster(taskTrackers, namenode, 2);
       final String jobTrackerName = "localhost:" + mr.getJobTrackerPort();
       JobConf jobConf = new JobConf();
       boolean result;
-      result = launchEmptyJob(namenode, jobTrackerName, jobConf, 
+      result = launchEmptyJob(fileSys.getUri(), jobTrackerName, jobConf, 
                               3, 1);
       assertTrue(result);
           

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRClasspath.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRClasspath.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRClasspath.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRClasspath.java Wed Feb 11 21:22:55 2009
@@ -19,6 +19,8 @@
 package org.apache.hadoop.mapred;
 
 import java.io.*;
+import java.net.URI;
+
 import junit.framework.TestCase;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
@@ -35,7 +37,7 @@
 public class TestMiniMRClasspath extends TestCase {
   
   
-  static String launchWordCount(String fileSys,
+  static String launchWordCount(URI fileSys,
                                 String jobTracker,
                                 JobConf conf,
                                 String input,
@@ -43,7 +45,7 @@
                                 int numReduces) throws IOException {
     final Path inDir = new Path("/testing/wc/input");
     final Path outDir = new Path("/testing/wc/output");
-    FileSystem fs = FileSystem.getNamed(fileSys, conf);
+    FileSystem fs = FileSystem.get(fileSys, conf);
     fs.delete(outDir, true);
     if (!fs.mkdirs(inDir)) {
       throw new IOException("Mkdirs failed to create " + inDir.toString());
@@ -93,13 +95,13 @@
     return result.toString();
   }
 
-  static String launchExternal(String fileSys, String jobTracker, JobConf conf,
+  static String launchExternal(URI uri, String jobTracker, JobConf conf,
                                String input, int numMaps, int numReduces)
     throws IOException {
 
     final Path inDir = new Path("/testing/ext/input");
     final Path outDir = new Path("/testing/ext/output");
-    FileSystem fs = FileSystem.getNamed(fileSys, conf);
+    FileSystem fs = FileSystem.get(uri, conf);
     fs.delete(outDir, true);
     if (!fs.mkdirs(inDir)) {
       throw new IOException("Mkdirs failed to create " + inDir.toString());
@@ -109,7 +111,7 @@
       file.writeBytes(input);
       file.close();
     }
-    FileSystem.setDefaultUri(conf, fileSys);
+    FileSystem.setDefaultUri(conf, uri);
     conf.set("mapred.job.tracker", jobTracker);
     conf.setJobName("wordcount");
     conf.setInputFormat(TextInputFormat.class);
@@ -160,12 +162,12 @@
       Configuration conf = new Configuration();
       dfs = new MiniDFSCluster(conf, 1, true, null);
       fileSys = dfs.getFileSystem();
-      namenode = fileSys.getName();
+      namenode = fileSys.getUri().toString();
       mr = new MiniMRCluster(taskTrackers, namenode, 3);
       JobConf jobConf = new JobConf();
       String result;
       final String jobTrackerName = "localhost:" + mr.getJobTrackerPort();
-      result = launchWordCount(namenode, jobTrackerName, jobConf, 
+      result = launchWordCount(fileSys.getUri(), jobTrackerName, jobConf, 
                                "The quick brown fox\nhas many silly\n" + 
                                "red fox sox\n",
                                3, 1);
@@ -194,13 +196,13 @@
       Configuration conf = new Configuration();
       dfs = new MiniDFSCluster(conf, 1, true, null);
       fileSys = dfs.getFileSystem();
-      namenode = fileSys.getName();
+      namenode = fileSys.getUri().toString();
       mr = new MiniMRCluster(taskTrackers, namenode, 3);      
       JobConf jobConf = new JobConf();
       String result;
       final String jobTrackerName = "localhost:" + mr.getJobTrackerPort();
       
-      result = launchExternal(namenode, jobTrackerName, jobConf, 
+      result = launchExternal(fileSys.getUri(), jobTrackerName, jobConf, 
                               "Dennis was here!\nDennis again!",
                               3, 1);
       assertEquals("Dennis again!\t1\nDennis was here!\t1\n", result);

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java Wed Feb 11 21:22:55 2009
@@ -38,7 +38,7 @@
       JobConf conf = new JobConf();
       dfs = new MiniDFSCluster(conf, 1, true, null);
       fileSys = dfs.getFileSystem();
-      mr = new MiniMRCluster(2, fileSys.getName(), 4);
+      mr = new MiniMRCluster(2, fileSys.getUri().toString(), 4);
       MRCaching.setupCache("/cachedir", fileSys);
       // run the wordcount example with caching
       TestResult ret = MRCaching.launchMRCache("/testing/wc/input",

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java Wed Feb 11 21:22:55 2009
@@ -187,7 +187,7 @@
       Configuration cnf = new Configuration();
       dfs = new MiniDFSCluster(cnf, 1, true, null);
       fileSys = dfs.getFileSystem();
-      mr = new MiniMRCluster(2, fileSys.getName(), 1);
+      mr = new MiniMRCluster(2, fileSys.getUri().toString(), 1);
       JobConf conf = mr.createJobConf();
       
       // intialize input, output and debug directories

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestSpecialCharactersInOutputPath.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestSpecialCharactersInOutputPath.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestSpecialCharactersInOutputPath.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestSpecialCharactersInOutputPath.java Wed Feb 11 21:22:55 2009
@@ -20,6 +20,7 @@
 
 import java.io.DataOutputStream;
 import java.io.IOException;
+import java.net.URI;
 
 import junit.framework.TestCase;
 
@@ -44,15 +45,15 @@
   
   private static final String OUTPUT_FILENAME = "result[0]";
   
-  public static boolean launchJob(String fileSys,
-                                       String jobTracker,
-                                       JobConf conf,
-                                       int numMaps,
-                                       int numReduces) throws IOException {
+  public static boolean launchJob(URI fileSys,
+                                  String jobTracker,
+                                  JobConf conf,
+                                  int numMaps,
+                                  int numReduces) throws IOException {
     
     final Path inDir = new Path("/testing/input");
     final Path outDir = new Path("/testing/output");
-    FileSystem fs = FileSystem.getNamed(fileSys, conf);
+    FileSystem fs = FileSystem.get(fileSys, conf);
     fs.delete(outDir, true);
     if (!fs.mkdirs(inDir)) {
       LOG.warn("Can't create " + inDir);
@@ -107,12 +108,12 @@
       Configuration conf = new Configuration();
       dfs = new MiniDFSCluster(conf, 1, true, null);
       fileSys = dfs.getFileSystem();
-      namenode = fileSys.getName();
+      namenode = fileSys.getUri().toString();
       mr = new MiniMRCluster(taskTrackers, namenode, 2);
       final String jobTrackerName = "localhost:" + mr.getJobTrackerPort();
       JobConf jobConf = new JobConf();
       boolean result;
-      result = launchJob(namenode, jobTrackerName, jobConf, 
+      result = launchJob(fileSys.getUri(), jobTrackerName, jobConf, 
                               3, 1);
       assertTrue(result);
           

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/pipes/TestPipes.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/pipes/TestPipes.java?rev=743513&r1=743512&r2=743513&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/pipes/TestPipes.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/pipes/TestPipes.java Wed Feb 11 21:22:55 2009
@@ -66,7 +66,7 @@
       final int numSlaves = 2;
       Configuration conf = new Configuration();
       dfs = new MiniDFSCluster(conf, numSlaves, true, null);
-      mr = new MiniMRCluster(numSlaves, dfs.getFileSystem().getName(), 1);
+      mr = new MiniMRCluster(numSlaves, dfs.getFileSystem().getUri().toString(), 1);
       writeInputFile(dfs.getFileSystem(), inputPath);
       runProgram(mr, dfs, new Path(cppExamples, "bin/wordcount-simple"), 
                  inputPath, outputPath, 3, 2, twoSplitOutput);