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

This reverts commit 1bc9b316ba.
This commit is contained in:
Brahma Reddy Battula 2017-01-03 19:26:44 +05:30
parent d6e5e4288c
commit 029b6fbe71
1 changed files with 2 additions and 9 deletions

View File

@ -667,9 +667,7 @@ protected HttpURLConnection connect(URL url) throws IOException {
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 {
@ -901,9 +899,7 @@ final T getResponse(HttpURLConnection conn) throws IOException {
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();
}
}
@ -950,9 +946,6 @@ public void close() throws IOException {
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();
}
}