diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java index 5f45f954fa8..55aeb466e7f 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java @@ -40,6 +40,7 @@ import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.protocol.SecretKeyProtocol; import org.apache.hadoop.hdds.protocolPB.SCMSecurityProtocolClientSideTranslatorPB; +import org.apache.hadoop.hdds.scm.ha.SCMHAUtils; import org.apache.hadoop.hdds.security.SecurityConfig; import org.apache.hadoop.hdds.security.symmetric.DefaultSecretKeyClient; import org.apache.hadoop.hdds.security.symmetric.SecretKeyClient; @@ -116,8 +117,7 @@ public class HddsDatanodeService extends GenericCli implements ServicePlugin { private final Map ratisMetricsMap = new ConcurrentHashMap<>(); private List ratisReporterList = null; - private DNMXBeanImpl serviceRuntimeInfo = - new DNMXBeanImpl(HddsVersionInfo.HDDS_VERSION_INFO) { }; + private DNMXBeanImpl serviceRuntimeInfo; private ObjectName dnInfoBeanName; private HddsDatanodeClientProtocolServer clientProtocolServer; private OzoneAdmins admins; @@ -210,6 +210,12 @@ public void start(OzoneConfiguration configuration) { } public void start() { + serviceRuntimeInfo = new DNMXBeanImpl(HddsVersionInfo.HDDS_VERSION_INFO) { + @Override + public String getNamespace() { + return SCMHAUtils.getScmServiceId(conf); + } + }; serviceRuntimeInfo.setStartTime(); ratisReporterList = RatisDropwizardExports diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/ServiceRuntimeInfo.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/ServiceRuntimeInfo.java index 3783613f3e3..f966ef00932 100644 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/ServiceRuntimeInfo.java +++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/ServiceRuntimeInfo.java @@ -33,6 +33,15 @@ */ public interface ServiceRuntimeInfo { + /** + * Gets the namespace of Ozone. + * + * @return the namespace + */ + default String getNamespace() { + return ""; + }; + /** * Gets the version of Hadoop. * diff --git a/hadoop-hdds/framework/src/main/resources/webapps/static/templates/overview.html b/hadoop-hdds/framework/src/main/resources/webapps/static/templates/overview.html index 30e2d26f56f..7ff118b330e 100644 --- a/hadoop-hdds/framework/src/main/resources/webapps/static/templates/overview.html +++ b/hadoop-hdds/framework/src/main/resources/webapps/static/templates/overview.html @@ -17,6 +17,10 @@

Overview

+ + + + diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java index ba52b7fcc5f..9390318a29f 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java @@ -2063,6 +2063,10 @@ public StatefulServiceStateManager getStatefulServiceStateManager() { return statefulServiceStateManager; } + @Override + public String getNamespace() { + return scmHANodeDetails.getLocalNodeDetails().getServiceId(); + } /** * Get the safe mode status of all rules. * diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java index eacd38375fb..2bb8c915b3c 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java @@ -3057,6 +3057,11 @@ private void unregisterMXBean() { } } + @Override + public String getNamespace() { + return omNodeDetails.getServiceId(); + } + @Override public String getRpcPort() { return "" + omRpcAddress.getPort();
Namespace:{{$ctrl.jmx.Namespace}}
Started: {{$ctrl.jmx.StartedTimeInMillis | date : 'medium'}}