-
Notifications
You must be signed in to change notification settings - Fork 499
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
base: master
Are you sure you want to change the base?
Conversation
LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aierate for the patch.
@@ -26,4 +26,6 @@ | |||
*/ | |||
@InterfaceAudience.Private | |||
public interface DNMXBean extends ServiceRuntimeInfo { | |||
|
|||
String getNamespace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you would like to display "namespace" in the generic overview section, I think getNamespace()
should be defined in ServiceRuntimeInfo
, where the other generic properties (started/version/compiled) are defined.
public String getNamespace() { | ||
return ""; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use default
method in the interface instead of overriding with dummy value.
<th>Namespace:</th> | ||
<td>{{$ctrl.jmx.Namespace}}</td> |
There was a problem hiding this comment.
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.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call existing method to determine the single service that the datanode belongs to:
ozone/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAUtils.java
Lines 172 to 192 in 4670a5e
public static String getScmServiceId(ConfigurationSource conf) { | |
String localScmServiceId = conf.getTrimmed( | |
ScmConfigKeys.OZONE_SCM_DEFAULT_SERVICE_ID); | |
Collection<String> scmServiceIds; | |
if (localScmServiceId == null) { | |
// There is no default scm service id is being set, fall back to ozone | |
// .scm.service.ids. | |
scmServiceIds = conf.getTrimmedStringCollection( | |
OZONE_SCM_SERVICE_IDS_KEY); | |
if (scmServiceIds.size() > 1) { | |
throw new ConfigurationException("When multiple SCM Service Ids are " + | |
"configured," + OZONE_SCM_DEFAULT_SERVICE_ID + " need to be " + | |
"defined"); | |
} else if (scmServiceIds.size() == 1) { | |
localScmServiceId = scmServiceIds.iterator().next(); | |
} | |
} | |
return localScmServiceId; |
to avoid duplication and mismatch (in case of change).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aierate for updating the patch.
@@ -33,6 +33,15 @@ | |||
*/ | |||
public interface ServiceRuntimeInfo { | |||
|
|||
/** | |||
* Gets the namespace of Hadoop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: reference to Hadoop in existing comments is outdated; no need to fix that, but let's not repeat it. :)
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java
77: Unused import - org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SERVICE_IDS_KEY.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adoroszlai Thank you for your very good suggestion. I have fixed these issues, please help me review again.
What changes were proposed in this pull request?
We have enhanced the web UI to display cluster information for OM (Ozone Manager), SCM (Storage Container Manager), and DN (DataNode).
Please describe your PR in detail:
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11563
How was this patch tested?
It is Only WebUI.
SCM
OM
Datanode