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:
parent
5ddaf2e133
commit
03163f9de2
|
@ -3558,7 +3558,7 @@ public class DataNode extends ReconfigurableBase
|
||||||
|
|
||||||
@Override // DataNodeMXBean
|
@Override // DataNodeMXBean
|
||||||
public String getHttpPort(){
|
public String getHttpPort(){
|
||||||
return this.getConf().get("dfs.datanode.info.port");
|
return String.valueOf(infoPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // DataNodeMXBean
|
@Override // DataNodeMXBean
|
||||||
|
|
|
@ -92,6 +92,7 @@ public class TestDataNodeMXBean extends SaslDataTransferTestCase {
|
||||||
Assert.assertEquals(datanode.getRpcPort(),rpcPort);
|
Assert.assertEquals(datanode.getRpcPort(),rpcPort);
|
||||||
// get attribute "HttpPort"
|
// get attribute "HttpPort"
|
||||||
String httpPort = (String)mbs.getAttribute(mxbeanName, "HttpPort");
|
String httpPort = (String)mbs.getAttribute(mxbeanName, "HttpPort");
|
||||||
|
Assert.assertNotNull(httpPort);
|
||||||
Assert.assertEquals(datanode.getHttpPort(),httpPort);
|
Assert.assertEquals(datanode.getHttpPort(),httpPort);
|
||||||
// get attribute "NamenodeAddresses"
|
// get attribute "NamenodeAddresses"
|
||||||
String namenodeAddresses = (String)mbs.getAttribute(mxbeanName,
|
String namenodeAddresses = (String)mbs.getAttribute(mxbeanName,
|
||||||
|
|
Loading…
Reference in New Issue