sumitagrawl commented on code in PR #5311:
URL: https://github.com/apache/ozone/pull/5311#discussion_r1382574344
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -3007,25 +3007,33 @@ public String getRpcPort() {
}
@Override
- public String getRatisRoles() {
+ public List<List<String>> getRatisRoles() {
List<ServiceInfo> serviceList;
+ List<List<String>> resultList = new ArrayList<>();
+ List<String> messageException = new ArrayList<>();
int port = omNodeDetails.getRatisPort();
RaftPeer leaderId;
if (isRatisEnabled) {
try {
leaderId = omRatisServer.getLeader();
if (leaderId == null) {
LOG.error("No leader found");
- return "Exception: Not a leader";
+ messageException.add("Exception: Not a Leader");
+ resultList.add(messageException);
+ return resultList;
}
serviceList = getServiceList();
} catch (IOException e) {
LOG.error("IO-Exception Occurred", e);
- return "Exception: " + e;
+ messageException.add("IO-Exception Occurred");
Review Comment:
we can add e.getMessage() for this, `messageException.add("IO-Exception
Occurred, " + e.getMessaage());`
##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html:
##########
@@ -49,6 +45,36 @@ <h2>Status</h2>
</tbody>
</table>
+<h4 ng-show="$ctrl.overview.jmx.RatisRoles.length == 1 &&
$ctrl.overview.jmx.RatisRoles[0].length == 1">Exception:
{{$ctrl.overview.jmx.RatisRoles[0]}}</h4>
+<div ng-show="$ctrl.overview.jmx.RatisRoles.length > 1">
+ <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 ng-repeat="roles in $ctrl.overview.jmx.RatisRoles">
+ <tr class="om-roles-background" ng-if="$ctrl.role.Id == roles[1]">
+ <td>{{roles[0]}}</td>
Review Comment:
If there is exception, how the output looks? do still accessing roles[1],...
can have issue over UI in exception case?
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java:
##########
@@ -20,6 +20,8 @@
import org.apache.hadoop.hdds.annotation.InterfaceAudience;
import org.apache.hadoop.hdds.server.ServiceRuntimeInfo;
+import java.util.List;
+import java.util.Map;
Review Comment:
Map is not more used, plz remove import, this may report findbug
--
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]