dombizita commented on code in PR #5311:
URL: https://github.com/apache/ozone/pull/5311#discussion_r1407549628
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -825,26 +825,18 @@ public static String format(List<ServiceInfo> nodes, int
port,
for (ServiceInfo info : omNodes) {
// Printing only the OM's running
if (info.getNodeType() == HddsProtos.NodeType.OM) {
- String role =
- info.getOmRoleInfo().getNodeId().equals(leaderId) ? "LEADER" :
- "FOLLOWER";
- sb.append(
- String.format(
- " { HostName: %s | Node-Id: %s | Ratis-Port : %d | Role: %s} ",
- info.getHostname(),
- info.getOmRoleInfo().getNodeId(),
- port,
- role
- ));
+ String role = info.getOmRoleInfo().getNodeId().equals(leaderId)
+ ? "LEADER" : "FOLLOWER";
+ List<String> omInfo = new ArrayList<>();
+ omInfo.add(info.getHostname());
+ omInfo.add(info.getOmRoleInfo().getNodeId());
+ omInfo.add(String.valueOf(port));
+ omInfo.add(role);
+ omInfoList.add(omInfo);
count++;
Review Comment:
I just realised that this `count` variable is not used anymore, we can
remove it, right? If yes, please also remove it from line 824 too.
##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html:
##########
@@ -49,6 +45,36 @@ <h2>Status</h2>
</tbody>
</table>
+<h2>OM Roles (HA)</h2>
+<h4 ng-show="$ctrl.overview.jmx.RatisRoles.length == 1 &&
$ctrl.overview.jmx.RatisRoles[0].length == 1">Exception:
{{$ctrl.overview.jmx.RatisRoles[0]}}</h4>
Review Comment:
I don't think we need the `Expection:` here, we have the necessary
information from the `getRatisRoles()` method.
Also if we use `{{$ctrl.overview.jmx.RatisRoles[0][0]}}` we won't have the
exception showed like this: `["Exception: Not a Leader"]`, but like this:
`Exception: Not a Leader`, right? I think it would be better this way.
```suggestion
<h4 ng-show="$ctrl.overview.jmx.RatisRoles.length == 1 &&
$ctrl.overview.jmx.RatisRoles[0].length ==
1">{{$ctrl.overview.jmx.RatisRoles[0][0]}}</h4>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]