瀏覽代碼

HDFS-6140. Merging change r1580173 from trunk to branch-2.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1580174 13f79535-47bb-0310-9956-ffa450edef68
Chris Nauroth 11 年之前
父節點
當前提交
6006427e9f

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -427,6 +427,9 @@ Release 2.4.0 - UNRELEASED
     HDFS-6131. Move HDFSHighAvailabilityWithNFS.apt.vm and 
     HDFSHighAvailabilityWithQJM.apt.vm from Yarn to HDFS. (jing9)
 
+    HDFS-6140. WebHDFS cannot create a file with spaces in the name after HA
+    failover changes. (cnauroth)
+
   BREAKDOWN OF HDFS-5698 SUBTASKS AND RELATED JIRAS
 
     HDFS-5717. Save FSImage header in protobuf. (Haohui Mai via jing9)

+ 1 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java

@@ -247,8 +247,7 @@ public class DatanodeWebHdfsMethods {
       }
       final String scheme = "http".equals(request.getScheme()) ?
       WebHdfsFileSystem.SCHEME : SWebHdfsFileSystem.SCHEME;
-      final URI uri = URI.create(String.format("%s://%s/%s", scheme,
-              nnId, fullpath));
+      final URI uri = new URI(scheme, nnId, fullpath, null, null);
       return Response.created(uri).type(MediaType.APPLICATION_OCTET_STREAM).build();
     }
     default:

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsFileSystemContract.java

@@ -504,7 +504,7 @@ public class TestWebHdfsFileSystemContract extends FileSystemContractBaseTest {
 
     {//test create with path containing spaces
       HttpOpParam.Op op = PutOpParam.Op.CREATE;
-      Path path = new Path("/test/path%20with%20spaces");
+      Path path = new Path("/test/path with spaces");
       URL url = webhdfs.toUrl(op, path);
       HttpURLConnection conn = (HttpURLConnection)url.openConnection();
       conn.setRequestMethod(op.getType().toString());