HDFS-8596. TestDistributedFileSystem et al tests are broken in branch-2 due to incorrect setting of "datanode" attribute. Contributed by Yongjun Zhang.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2b93ab3d Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2b93ab3d Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2b93ab3d Branch: refs/heads/YARN-2928 Commit: 2b93ab3d26ce275e5f35bfc7d116abb4588d9249 Parents: fb7f8ec Author: Yongjun Zhang <yzh...@cloudera.com> Authored: Sun Jun 14 11:20:32 2015 -0700 Committer: Zhijie Shen <zjs...@apache.org> Committed: Thu Jun 18 11:10:05 2015 -0700 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/hdfs/server/datanode/DataNode.java | 2 +- .../hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b93ab3d/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 9aabd34..1caa8c5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1002,6 +1002,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 http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b93ab3d/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java index ed2925b..3bd131e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java @@ -762,7 +762,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(); http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b93ab3d/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java index e9ad92f..62c98e7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java @@ -75,6 +75,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; @@ -91,7 +92,7 @@ public class DatanodeHttpServer implements Closeable { this.infoServer = builder.build(); - 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);