Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -26,4 +26,6 @@
*/
@InterfaceAudience.Private
public interface DNMXBean extends ServiceRuntimeInfo {

String getNamespace();
Comment thread
adoroszlai marked this conversation as resolved.
Outdated
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ public DNMXBeanImpl(
VersionInfo versionInfo) {
super(versionInfo);
}

public String getNamespace() {
return "";
}
Comment thread
adoroszlai marked this conversation as resolved.
Outdated
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.IOException;
import java.net.InetAddress;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -40,6 +41,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.ScmConfigKeys;
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 +75,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;
Comment thread
adoroszlai marked this conversation as resolved.
Outdated
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 +119,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 +212,18 @@ public void start(OzoneConfiguration configuration) {
}

public void start() {
serviceRuntimeInfo = new DNMXBeanImpl(HddsVersionInfo.HDDS_VERSION_INFO) {
@Override
public String getNamespace() {
String localScmServiceId = conf.getTrimmed(
ScmConfigKeys.OZONE_SCM_DEFAULT_SERVICE_ID);
if (localScmServiceId == null) {
Collection<String> scmServiceIds = conf.getTrimmedStringCollection(OZONE_SCM_SERVICE_IDS_KEY);
return String.join(",", scmServiceIds);
}
return localScmServiceId;
Comment thread
adoroszlai marked this conversation as resolved.
Outdated
}
};
serviceRuntimeInfo.setStartTime();

ratisReporterList = RatisDropwizardExports
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>
Comment thread
adoroszlai marked this conversation as 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 @@ -31,6 +31,7 @@
@InterfaceAudience.Private
public interface SCMMXBean extends ServiceRuntimeInfo {

String getNamespace();
/**
* Get the SCM RPC server port that used to listen to datanode requests.
* @return SCM datanode RPC server port
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 @@ -28,6 +28,8 @@
@InterfaceAudience.Private
public interface OMMXBean extends ServiceRuntimeInfo {

String getNamespace();

String getRpcPort();

List<List<String>> getRatisRoles();
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