Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDFS-17369. Add uuid into datanode info for NameNodeMXBean #6521

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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);
}
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,15 @@ 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"));
Map<String, Map<String, Object>> liveNodes1 =
(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
Expand Down
Loading