HDFS-3158. LiveNodes member of NameNodeMXBean should list non-DFS used space and capacity per DN. Contributed by Aaron T. Myers.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1306635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
99a68a1423
commit
17d22e6dc4
@ -279,6 +279,9 @@ Release 2.0.0 - UNRELEASED
|
|||||||
|
|
||||||
HDFS-3155. Clean up FSDataset implemenation related code. (szetszwo)
|
HDFS-3155. Clean up FSDataset implemenation related code. (szetszwo)
|
||||||
|
|
||||||
|
HDFS-3158. LiveNodes member of NameNodeMXBean should list non-DFS used
|
||||||
|
space and capacity per DN. (atm)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HDFS-3024. Improve performance of stringification in addStoredBlock (todd)
|
HDFS-3024. Improve performance of stringification in addStoredBlock (todd)
|
||||||
|
@ -5072,6 +5072,8 @@ public String getLiveNodes() {
|
|||||||
innerinfo.put("lastContact", getLastContact(node));
|
innerinfo.put("lastContact", getLastContact(node));
|
||||||
innerinfo.put("usedSpace", getDfsUsed(node));
|
innerinfo.put("usedSpace", getDfsUsed(node));
|
||||||
innerinfo.put("adminState", node.getAdminState().toString());
|
innerinfo.put("adminState", node.getAdminState().toString());
|
||||||
|
innerinfo.put("nonDfsUsedSpace", node.getNonDfsUsed());
|
||||||
|
innerinfo.put("capacity", node.getCapacity());
|
||||||
info.put(node.getHostName(), innerinfo);
|
info.put(node.getHostName(), innerinfo);
|
||||||
}
|
}
|
||||||
return JSON.toString(info);
|
return JSON.toString(info);
|
||||||
|
@ -93,6 +93,15 @@ public void testNameNodeMXBeanInfo() throws Exception {
|
|||||||
// get attribute alivenodeinfo
|
// get attribute alivenodeinfo
|
||||||
String alivenodeinfo = (String) (mbs.getAttribute(mxbeanName,
|
String alivenodeinfo = (String) (mbs.getAttribute(mxbeanName,
|
||||||
"LiveNodes"));
|
"LiveNodes"));
|
||||||
|
Map<String, Map<String, Object>> liveNodes =
|
||||||
|
(Map<String, Map<String, Object>>) JSON.parse(alivenodeinfo);
|
||||||
|
assertTrue(liveNodes.size() > 0);
|
||||||
|
for (Map<String, Object> liveNode : liveNodes.values()) {
|
||||||
|
assertTrue(liveNode.containsKey("nonDfsUsedSpace"));
|
||||||
|
assertTrue(((Long)liveNode.get("nonDfsUsedSpace")) > 0);
|
||||||
|
assertTrue(liveNode.containsKey("capacity"));
|
||||||
|
assertTrue(((Long)liveNode.get("capacity")) > 0);
|
||||||
|
}
|
||||||
Assert.assertEquals(fsn.getLiveNodes(), alivenodeinfo);
|
Assert.assertEquals(fsn.getLiveNodes(), alivenodeinfo);
|
||||||
// get attribute deadnodeinfo
|
// get attribute deadnodeinfo
|
||||||
String deadnodeinfo = (String) (mbs.getAttribute(mxbeanName,
|
String deadnodeinfo = (String) (mbs.getAttribute(mxbeanName,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user