sumitagrawl commented on code in PR #5311:
URL: https://github.com/apache/ozone/pull/5311#discussion_r1350287502
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2956,16 +2956,16 @@ public String getRatisRoles() {
leaderId = omRatisServer.getLeader();
if (leaderId == null) {
LOG.error("No leader found");
- return "Exception: Not a leader";
+ return Collections.emptyList();
}
serviceList = getServiceList();
} catch (IOException e) {
LOG.error("IO-Exception Occurred", e);
- return "Exception: " + e;
+ return Collections.emptyList();
}
return OmUtils.format(serviceList, port, leaderId.getId().toString());
} else {
- return "Ratis-Disabled";
+ return Collections.emptyList();
Review Comment:
In case of standalone, i.e. ratis disabled, how the info will be shown? as
list is empty
can see node info showing "CANDIDATE", do that will be enough?
##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html:
##########
@@ -49,6 +45,35 @@ <h2>Status</h2>
</tbody>
</table>
+<div ng-show="$ctrl.overview.jmx.RatisRoles.length > 0">
+ <h2>OM Roles (HA)</h2>
+ <table class="table table-striped table-bordered" class="col-md-6">
+ <thead>
+ <tr>
+ <th>Host Name</th>
+ <th>Node ID</th>
+ <th>Ratis Port</th>
+ <th>Role</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="om-roles-background" ng-repeat="roles in
$ctrl.overview.jmx.RatisRoles"
+ ng-if="$ctrl.role.Id == roles[2].value">
+ <td>{{roles[3].value}}</td>
Review Comment:
there is assumption that index as in order represent hostname, nodeid, port,
role. Do this is valid for all scenario? or need get based on string in json
map ?
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2956,16 +2956,16 @@ public String getRatisRoles() {
leaderId = omRatisServer.getLeader();
if (leaderId == null) {
LOG.error("No leader found");
- return "Exception: Not a leader";
+ return Collections.emptyList();
Review Comment:
How to show "Not a leader" or any exception occured in system? if exeption
is happening, instead of empty list, need throw exception.
--
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]