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

HDDS-11563. [OM/SCM/DN] WebUI Display Namespace #7321

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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 @@ -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;
Expand Down Expand Up @@ -116,8 +117,7 @@ public class HddsDatanodeService extends GenericCli implements ServicePlugin {
private final Map<String, RatisDropwizardExports> ratisMetricsMap =
new ConcurrentHashMap<>();
private List<RatisDropwizardExports.MetricReporter> ratisReporterList = null;
private DNMXBeanImpl serviceRuntimeInfo =
new DNMXBeanImpl(HddsVersionInfo.HDDS_VERSION_INFO) { };
private DNMXBeanImpl serviceRuntimeInfo;
private ObjectName dnInfoBeanName;
private HddsDatanodeClientProtocolServer clientProtocolServer;
private OzoneAdmins admins;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
*/
public interface ServiceRuntimeInfo {

/**
* Gets the namespace of Ozone.
*
* @return the namespace
*/
default String getNamespace() {
return "";
};

/**
* Gets the version of Hadoop.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<h1>Overview</h1>
<table class="table table-bordered table-striped">
<tbody>
<tr ng-if="$ctrl.jmx.Namespace && $ctrl.jmx.Namespace !== ''">
<th>Namespace:</th>
<td>{{$ctrl.jmx.Namespace}}</td>
Comment on lines +21 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be displayed conditionally, only if not empty. Only HA setup has service ID.

</tr>
<tr>
<th>Started:</th>
<td>{{$ctrl.jmx.StartedTimeInMillis | date : 'medium'}}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3061,6 +3061,11 @@ private void unregisterMXBean() {
}
}

@Override
public String getNamespace() {
return omNodeDetails.getServiceId();
}

@Override
public String getRpcPort() {
return "" + omRpcAddress.getPort();
Expand Down