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

Merged
merged 4 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -73,6 +74,7 @@

import static org.apache.hadoop.hdds.protocol.DatanodeDetails.Port.Name.HTTP;
import static org.apache.hadoop.hdds.protocol.DatanodeDetails.Port.Name.HTTPS;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SERVICE_IDS_KEY;
adoroszlai marked this conversation as resolved.
Show resolved Hide resolved
import static org.apache.hadoop.hdds.utils.HddsServerUtil.getRemoteUser;
import static org.apache.hadoop.hdds.utils.HddsServerUtil.getScmSecurityClientWithMaxRetry;
import static org.apache.hadoop.ozone.OzoneConfigKeys.HDDS_DATANODE_PLUGINS_KEY;
Expand Down Expand Up @@ -116,8 +118,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 +211,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 Hadoop.
adoroszlai marked this conversation as resolved.
Show resolved Hide resolved
*
* @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>
<th>Namespace:</th>
<td>{{$ctrl.jmx.Namespace}}</td>
adoroszlai marked this conversation as resolved.
Show resolved Hide resolved
</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