Revert "HDFS-11280. Allow WebHDFS to reuse HTTP connections to NN. Contributed by Zheng Shao."
This reverts commit d90f7412f2162550d3cc9a3ae33f330e7114bc5c. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/a3f4ee53 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/a3f4ee53 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/a3f4ee53 Branch: refs/heads/branch-2.7 Commit: a3f4ee53c80a169b15e24d63032081740b741f39 Parents: d90f741 Author: Brahma Reddy Battula <[email protected]> Authored: Tue Jan 3 19:32:39 2017 +0530 Committer: Brahma Reddy Battula <[email protected]> Committed: Tue Jan 3 19:32:39 2017 +0530 ---------------------------------------------------------------------- .../org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/a3f4ee53/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java index a599705..ccfed0b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java @@ -545,9 +545,7 @@ public class WebHdfsFileSystem extends FileSystem url = new URL(conn.getHeaderField("Location")); redirectHost = url.getHost() + ":" + url.getPort(); } finally { - // Don't call conn.disconnect() to allow connection reuse - // See http://tinyurl.com/java7-http-keepalive - conn.getInputStream().close(); + conn.disconnect(); } } try { @@ -776,9 +774,7 @@ public class WebHdfsFileSystem extends FileSystem } throw ioe; } finally { - // Don't call conn.disconnect() to allow connection reuse - // See http://tinyurl.com/java7-http-keepalive - conn.getInputStream().close(); + conn.disconnect(); } } @@ -824,9 +820,6 @@ public class WebHdfsFileSystem extends FileSystem try { validateResponse(op, conn, true); } finally { - // This is a connection to DataNode. Let's disconnect since - // there is little chance that the connection will be reused - // any time soonl conn.disconnect(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
