HDFS-8596. TestDistributedFileSystem et al tests are broken in branch-2 due to incorrect setting of "datanode" attribute. Contributed by Yongjun Zhang.

(cherry picked from commit b0dc291961)

Conflicts:
	hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java
This commit is contained in:
Yongjun Zhang 2015-06-14 11:20:32 -07:00
parent 92144ca75c
commit cd578fa289
3 changed files with 6 additions and 2 deletions

View File

@ -665,6 +665,9 @@ Release 2.7.1 - UNRELEASED
HDFS-8572. DN always uses HTTP/localhost@REALM principals in SPNEGO.
(wheat9)
HDFS-8596. TestDistributedFileSystem et al tests are broken in branch-2
due to incorrect setting of "datanode" attribute. (Yongjun Zhang)
Release 2.7.0 - 2015-04-20
INCOMPATIBLE CHANGES

View File

@ -763,7 +763,7 @@ public class DataNode extends ReconfigurableBase
ServerSocketChannel httpServerChannel = secureResources != null ?
secureResources.getHttpServerChannel() : null;
this.httpServer = new DatanodeHttpServer(conf, httpServerChannel);
this.httpServer = new DatanodeHttpServer(conf, this, httpServerChannel);
httpServer.start();
if (httpServer.getHttpAddress() != null) {
infoPort = httpServer.getHttpAddress().getPort();

View File

@ -77,6 +77,7 @@ public class DatanodeHttpServer implements Closeable {
static final Log LOG = LogFactory.getLog(DatanodeHttpServer.class);
public DatanodeHttpServer(final Configuration conf,
final DataNode datanode,
final ServerSocketChannel externalHttpChannel)
throws IOException {
this.conf = conf;
@ -97,7 +98,7 @@ public class DatanodeHttpServer implements Closeable {
this.infoServer.addInternalServlet(null, "/getFileChecksum/*",
FileChecksumServlets.GetServlet.class);
this.infoServer.setAttribute("datanode", this);
this.infoServer.setAttribute("datanode", datanode);
this.infoServer.setAttribute(JspHelper.CURRENT_CONF, conf);
this.infoServer.addServlet(null, "/blockScannerReport",
BlockScanner.Servlet.class);