[34/50] [abbrv] hadoop git commit: HDFS-6662. WebHDFS cannot open a file if its path contains %. Contributed by Gerson Carlos.
HDFS-6662. WebHDFS cannot open a file if its path contains %. Contributed by Gerson Carlos. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/043e44bc Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/043e44bc Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/043e44bc Branch: refs/heads/YARN-2928 Commit: 043e44bc36fc7f7c59406d3722b0a93607b6fa49 Parents: 00b8095 Author: Haohui Mai whe...@apache.org Authored: Tue Feb 17 13:04:38 2015 -0800 Committer: Haohui Mai whe...@apache.org Committed: Tue Feb 17 13:04:38 2015 -0800 -- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt| 3 +++ .../server/datanode/web/webhdfs/ParameterParser.java | 2 +- .../hadoop-hdfs/src/main/webapps/hdfs/explorer.js | 7 +++ .../datanode/web/webhdfs/TestParameterParser.java | 13 + 4 files changed, 24 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/043e44bc/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 48eb61c..391005c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -970,6 +970,9 @@ Release 2.7.0 - UNRELEASED HDFS-7798. Checkpointing failure caused by shared KerberosAuthenticator. (Chengbing Liu via yliu) +HDFS-6662. WebHDFS cannot open a file if its path contains %. +(Gerson Carlos via wheat9) + BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS HDFS-7720. Quota by Storage Type API, tools and ClientNameNode http://git-wip-us.apache.org/repos/asf/hadoop/blob/043e44bc/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java index e1930b0..5749504 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java @@ -50,7 +50,7 @@ class ParameterParser { private final MapString, ListString params; ParameterParser(QueryStringDecoder decoder, Configuration conf) { -this.path = decoder.path().substring(WEBHDFS_PREFIX_LENGTH); +this.path = QueryStringDecoder.decodeComponent(decoder.path().substring(WEBHDFS_PREFIX_LENGTH)); this.params = decoder.parameters(); this.conf = conf; } http://git-wip-us.apache.org/repos/asf/hadoop/blob/043e44bc/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js index ca73506..87d47fa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js @@ -102,6 +102,13 @@ menus.change(); } +function encode_path(abs_path) { + abs_path = encodeURIComponent(abs_path); + var re = /%2F/g; + return abs_path.replace(re, '/'); +} + +abs_path = encode_path(abs_path); var url = '/webhdfs/v1' + abs_path + '?op=GET_BLOCK_LOCATIONS'; $.get(url).done(function(data) { var d = get_response(data, LocatedBlocks); http://git-wip-us.apache.org/repos/asf/hadoop/blob/043e44bc/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java index 8b4235b..6a6c5d0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java @@ -52,4 +52,17 @@ public class TestParameterParser { final TokenDelegationTokenIdentifier tok2 = testParser.delegationToken(); Assert.assertTrue(HAUtil.isTokenForLogicalUri(tok2)); } + + @Test
hadoop git commit: HDFS-6662. WebHDFS cannot open a file if its path contains %. Contributed by Gerson Carlos.
Repository: hadoop Updated Branches: refs/heads/branch-2 411c8a7cd - f92a4904b HDFS-6662. WebHDFS cannot open a file if its path contains %. Contributed by Gerson Carlos. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f92a4904 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f92a4904 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f92a4904 Branch: refs/heads/branch-2 Commit: f92a4904bf4822eb6e73e6d225dd2d40c7975315 Parents: 411c8a7 Author: Haohui Mai whe...@apache.org Authored: Tue Feb 17 13:04:38 2015 -0800 Committer: Haohui Mai whe...@apache.org Committed: Tue Feb 17 13:05:00 2015 -0800 -- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt| 3 +++ .../server/datanode/web/webhdfs/ParameterParser.java | 2 +- .../hadoop-hdfs/src/main/webapps/hdfs/explorer.js | 7 +++ .../datanode/web/webhdfs/TestParameterParser.java | 13 + 4 files changed, 24 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/f92a4904/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 9bd4fa8..a13014a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -673,6 +673,9 @@ Release 2.7.0 - UNRELEASED HDFS-7798. Checkpointing failure caused by shared KerberosAuthenticator. (Chengbing Liu via yliu) +HDFS-6662. WebHDFS cannot open a file if its path contains %. +(Gerson Carlos via wheat9) + BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS HDFS-7720. Quota by Storage Type API, tools and ClientNameNode http://git-wip-us.apache.org/repos/asf/hadoop/blob/f92a4904/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java index e1930b0..5749504 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java @@ -50,7 +50,7 @@ class ParameterParser { private final MapString, ListString params; ParameterParser(QueryStringDecoder decoder, Configuration conf) { -this.path = decoder.path().substring(WEBHDFS_PREFIX_LENGTH); +this.path = QueryStringDecoder.decodeComponent(decoder.path().substring(WEBHDFS_PREFIX_LENGTH)); this.params = decoder.parameters(); this.conf = conf; } http://git-wip-us.apache.org/repos/asf/hadoop/blob/f92a4904/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js index ca73506..87d47fa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js @@ -102,6 +102,13 @@ menus.change(); } +function encode_path(abs_path) { + abs_path = encodeURIComponent(abs_path); + var re = /%2F/g; + return abs_path.replace(re, '/'); +} + +abs_path = encode_path(abs_path); var url = '/webhdfs/v1' + abs_path + '?op=GET_BLOCK_LOCATIONS'; $.get(url).done(function(data) { var d = get_response(data, LocatedBlocks); http://git-wip-us.apache.org/repos/asf/hadoop/blob/f92a4904/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java index 8b4235b..6a6c5d0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java @@ -52,4 +52,17 @@ public class TestParameterParser { final TokenDelegationTokenIdentifier tok2 =
hadoop git commit: HDFS-6662. WebHDFS cannot open a file if its path contains %. Contributed by Gerson Carlos.
Repository: hadoop Updated Branches: refs/heads/trunk 00b80958d - 043e44bc3 HDFS-6662. WebHDFS cannot open a file if its path contains %. Contributed by Gerson Carlos. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/043e44bc Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/043e44bc Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/043e44bc Branch: refs/heads/trunk Commit: 043e44bc36fc7f7c59406d3722b0a93607b6fa49 Parents: 00b8095 Author: Haohui Mai whe...@apache.org Authored: Tue Feb 17 13:04:38 2015 -0800 Committer: Haohui Mai whe...@apache.org Committed: Tue Feb 17 13:04:38 2015 -0800 -- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt| 3 +++ .../server/datanode/web/webhdfs/ParameterParser.java | 2 +- .../hadoop-hdfs/src/main/webapps/hdfs/explorer.js | 7 +++ .../datanode/web/webhdfs/TestParameterParser.java | 13 + 4 files changed, 24 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/043e44bc/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 48eb61c..391005c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -970,6 +970,9 @@ Release 2.7.0 - UNRELEASED HDFS-7798. Checkpointing failure caused by shared KerberosAuthenticator. (Chengbing Liu via yliu) +HDFS-6662. WebHDFS cannot open a file if its path contains %. +(Gerson Carlos via wheat9) + BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS HDFS-7720. Quota by Storage Type API, tools and ClientNameNode http://git-wip-us.apache.org/repos/asf/hadoop/blob/043e44bc/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java index e1930b0..5749504 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/ParameterParser.java @@ -50,7 +50,7 @@ class ParameterParser { private final MapString, ListString params; ParameterParser(QueryStringDecoder decoder, Configuration conf) { -this.path = decoder.path().substring(WEBHDFS_PREFIX_LENGTH); +this.path = QueryStringDecoder.decodeComponent(decoder.path().substring(WEBHDFS_PREFIX_LENGTH)); this.params = decoder.parameters(); this.conf = conf; } http://git-wip-us.apache.org/repos/asf/hadoop/blob/043e44bc/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js index ca73506..87d47fa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js @@ -102,6 +102,13 @@ menus.change(); } +function encode_path(abs_path) { + abs_path = encodeURIComponent(abs_path); + var re = /%2F/g; + return abs_path.replace(re, '/'); +} + +abs_path = encode_path(abs_path); var url = '/webhdfs/v1' + abs_path + '?op=GET_BLOCK_LOCATIONS'; $.get(url).done(function(data) { var d = get_response(data, LocatedBlocks); http://git-wip-us.apache.org/repos/asf/hadoop/blob/043e44bc/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java index 8b4235b..6a6c5d0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/web/webhdfs/TestParameterParser.java @@ -52,4 +52,17 @@ public class TestParameterParser { final TokenDelegationTokenIdentifier tok2 = testParser.delegationToken();