Revert "HDFS-11280. Allow WebHDFS to reuse HTTP connections to NN. Contributed 
by Zheng Shao."

This reverts commit b811a1c14d00ab236158ab75fad1fe41364045a4.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/b31e1951
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/b31e1951
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/b31e1951

Branch: refs/heads/YARN-3926
Commit: b31e1951e044b2c6f6e88a007a8c175941ddd674
Parents: 6938b67
Author: Brahma Reddy Battula <bra...@apache.org>
Authored: Tue Jan 3 19:19:29 2017 +0530
Committer: Brahma Reddy Battula <bra...@apache.org>
Committed: Tue Jan 3 19:19:29 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/b31e1951/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
index c89913e..26cfc01 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
@@ -659,9 +659,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 {
@@ -893,9 +891,7 @@ public class WebHdfsFileSystem extends FileSystem
         LOG.debug("Response decoding failure.", e);
         throw ioe;
       } finally {
-        // Don't call conn.disconnect() to allow connection reuse
-        // See http://tinyurl.com/java7-http-keepalive
-        conn.getInputStream().close();
+        conn.disconnect();
       }
     }
 
@@ -942,9 +938,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: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to