HDFS-17011. Fix the metric of "HttpPort" at DataNodeInfo (#5657). Contributed by Zhaohui Wang.

Reviewed-by: Inigo Goiri <inigoiri@apache.org>
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
wangzhaohui 2023-05-18 14:42:11 +08:00 committed by Ayush Saxena
parent ab594ec77e
commit 5cafa1fdb9
No known key found for this signature in database
GPG Key ID: D09AE71061AB564D
2 changed files with 2 additions and 1 deletions

View File

@ -3435,7 +3435,7 @@ public class DataNode extends ReconfigurableBase
@Override // DataNodeMXBean
public String getHttpPort(){
return this.getConf().get("dfs.datanode.info.port");
return String.valueOf(infoPort);
}
@Override // DataNodeMXBean

View File

@ -92,6 +92,7 @@ public class TestDataNodeMXBean extends SaslDataTransferTestCase {
Assert.assertEquals(datanode.getRpcPort(),rpcPort);
// get attribute "HttpPort"
String httpPort = (String)mbs.getAttribute(mxbeanName, "HttpPort");
Assert.assertNotNull(httpPort);
Assert.assertEquals(datanode.getHttpPort(),httpPort);
// get attribute "NamenodeAddresses"
String namenodeAddresses = (String)mbs.getAttribute(mxbeanName,