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

This reverts commit 0ff9efcf37.
This commit is contained in:
Brahma Reddy Battula 2017-01-03 19:30:45 +05:30
parent b8be8f0d4f
commit 7392a5a72c
1 changed files with 2 additions and 9 deletions

View File

@ -663,9 +663,7 @@ public class WebHdfsFileSystem extends FileSystem
url = new URL(conn.getHeaderField("Location")); url = new URL(conn.getHeaderField("Location"));
redirectHost = url.getHost() + ":" + url.getPort(); redirectHost = url.getHost() + ":" + url.getPort();
} finally { } finally {
// Don't call conn.disconnect() to allow connection reuse conn.disconnect();
// See http://tinyurl.com/java7-http-keepalive
conn.getInputStream().close();
} }
} }
try { try {
@ -897,9 +895,7 @@ public class WebHdfsFileSystem extends FileSystem
LOG.debug("Response decoding failure.", e); LOG.debug("Response decoding failure.", e);
throw ioe; throw ioe;
} finally { } finally {
// Don't call conn.disconnect() to allow connection reuse conn.disconnect();
// See http://tinyurl.com/java7-http-keepalive
conn.getInputStream().close();
} }
} }
@ -946,9 +942,6 @@ public class WebHdfsFileSystem extends FileSystem
try { try {
validateResponse(op, conn, true); validateResponse(op, conn, true);
} finally { } 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(); conn.disconnect();
} }
} }