HDFS-7303. NN UI fails to distinguish datanodes on the same host. Contributed by Benoy Antony.

This commit is contained in:
Haohui Mai 2014-11-24 17:46:35 -08:00
parent 9d462fb60c
commit 57a76f71bd
3 changed files with 9 additions and 7 deletions

View File

@ -223,9 +223,12 @@ Release 2.7.0 - UNRELEASED
HDFS-7374. Allow decommissioning of dead DataNodes. (Zhe Zhang)
HDFS-7403. Inaccurate javadoc of BlockUCState#COMPLETE state. (
HDFS-7403. Inaccurate javadoc of BlockUCState#COMPLETE state. (
Yongjun Zhang via yliu)
HDFS-7303. NN UI fails to distinguish datanodes on the same host.
(Benoy Antony via wheat9)
Release 2.6.1 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -7248,8 +7248,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
.put("blockPoolUsedPercent", node.getBlockPoolUsedPercent())
.put("volfails", node.getVolumeFailures())
.build();
info.put(node.getHostName(), innerinfo);
info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo);
}
return JSON.toString(info);
}
@ -7270,7 +7269,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
.put("decommissioned", node.isDecommissioned())
.put("xferaddr", node.getXferAddr())
.build();
info.put(node.getHostName(), innerinfo);
info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo);
}
return JSON.toString(info);
}
@ -7297,7 +7296,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
.put("underReplicateInOpenFiles",
node.decommissioningStatus.getUnderReplicatedInOpenFiles())
.build();
info.put(node.getHostName(), innerinfo);
info.put(node.getHostName() + ":" + node.getXferPort(), innerinfo);
}
return JSON.toString(info);
}

View File

@ -67,7 +67,7 @@ public class TestNameNodeMXBean {
MiniDFSCluster cluster = null;
try {
cluster = new MiniDFSCluster.Builder(conf).build();
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
cluster.waitActive();
FSNamesystem fsn = cluster.getNameNode().namesystem;
@ -111,7 +111,7 @@ public class TestNameNodeMXBean {
"LiveNodes"));
Map<String, Map<String, Object>> liveNodes =
(Map<String, Map<String, Object>>) JSON.parse(alivenodeinfo);
assertTrue(liveNodes.size() > 0);
assertTrue(liveNodes.size() == 2);
for (Map<String, Object> liveNode : liveNodes.values()) {
assertTrue(liveNode.containsKey("nonDfsUsedSpace"));
assertTrue(((Long)liveNode.get("nonDfsUsedSpace")) > 0);