HDFS-17369. Add uuid into datanode info for NameNodeMXBean (#6521) Contributed by Haiyang Hu.
Reviewed-by: ZanderXu <zanderxu@apache.org> Signed-off-by: Shilun Fan <slfan1989@apache.org>
This commit is contained in:
parent
d74e5160cd
commit
6464507cd1
@ -6662,6 +6662,7 @@ public String getLiveNodes() {
|
||||
.put("infoSecureAddr", node.getInfoSecureAddr())
|
||||
.put("xferaddr", node.getXferAddr())
|
||||
.put("location", node.getNetworkLocation())
|
||||
.put("uuid", node.getDatanodeUuid())
|
||||
.put("lastContact", getLastContact(node))
|
||||
.put("usedSpace", getDfsUsed(node))
|
||||
.put("adminState", node.getAdminState().toString())
|
||||
@ -6715,6 +6716,7 @@ public String getDeadNodes() {
|
||||
.put("adminState", node.getAdminState().toString())
|
||||
.put("xferaddr", node.getXferAddr())
|
||||
.put("location", node.getNetworkLocation())
|
||||
.put("uuid", node.getDatanodeUuid())
|
||||
.build();
|
||||
info.put(node.getXferAddrWithHostname(), innerinfo);
|
||||
}
|
||||
@ -6737,6 +6739,7 @@ public String getDecomNodes() {
|
||||
.<String, Object> builder()
|
||||
.put("xferaddr", node.getXferAddr())
|
||||
.put("location", node.getNetworkLocation())
|
||||
.put("uuid", node.getDatanodeUuid())
|
||||
.put("underReplicatedBlocks",
|
||||
node.getLeavingServiceStatus().getUnderReplicatedBlocks())
|
||||
.put("decommissionOnlyReplicas",
|
||||
@ -6767,6 +6770,7 @@ public String getEnteringMaintenanceNodes() {
|
||||
.<String, Object> builder()
|
||||
.put("xferaddr", node.getXferAddr())
|
||||
.put("location", node.getNetworkLocation())
|
||||
.put("uuid", node.getDatanodeUuid())
|
||||
.put("underReplicatedBlocks",
|
||||
node.getLeavingServiceStatus().getUnderReplicatedBlocks())
|
||||
.put("maintenanceOnlyReplicas",
|
||||
|
@ -211,7 +211,7 @@ public void testNameNodeMXBeanInfo() throws Exception {
|
||||
cluster.getDataNodes().get(3).getDatanodeId());
|
||||
decommissionedNode.setDecommissioned();
|
||||
|
||||
// Assert the location field is included in the mxbeanName
|
||||
// Assert the location and uuid field is included in the mxbeanName
|
||||
// under different states
|
||||
String alivenodeinfo1 = (String) (mbs.getAttribute(mxbeanName,
|
||||
"LiveNodes"));
|
||||
@ -219,6 +219,7 @@ public void testNameNodeMXBeanInfo() throws Exception {
|
||||
(Map<String, Map<String, Object>>) JSON.parse(alivenodeinfo1);
|
||||
for (Map<String, Object> liveNode : liveNodes1.values()) {
|
||||
assertTrue(liveNode.containsKey("location"));
|
||||
assertTrue(liveNode.containsKey("uuid"));
|
||||
}
|
||||
|
||||
// get attributes DeadNodes
|
||||
|
Loading…
Reference in New Issue
Block a user