diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 0c350544dc..fd930a867b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -668,6 +668,9 @@ Release 2.4.0 - UNRELEASED HDFS-6127. WebHDFS tokens cannot be renewed in HA setup. (wheat9) + 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) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java index ea0a08f695..5472731fa4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/resources/DatanodeWebHdfsMethods.java @@ -247,8 +247,7 @@ private Response put( } 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: diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsFileSystemContract.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsFileSystemContract.java index da23a593da..9a0245cff8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsFileSystemContract.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHdfsFileSystemContract.java @@ -504,7 +504,7 @@ public void testResponseCode() throws IOException { {//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());