sadanand48 commented on code in PR #3520:
URL: https://github.com/apache/ozone/pull/3520#discussion_r898735094
##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/ozoneManager.js:
##########
@@ -113,5 +113,12 @@
require: {
overview: "^overview"
},
+ controller: function ($http) {
+ var ctrl = this;
+
$http.get("http://localhost:9874/jmx?qry=Ratis:service=RaftServer,group=*,id=*")
Review Comment:
Don't need localhost here
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
}
@Override
+
+ public String getOmRatisRoles() {
+ List<ServiceInfo> serviceList = null;
+ StringBuilder sb = new StringBuilder();
+ try {
+ serviceList = getServiceList();
+ } catch (IOException e) {
+ return "";
+ }
+ for (ServiceInfo info : serviceList) {
+ if (info.getOmRoleInfo() != null) {
+ sb.append(
+ String.format(
Review Comment:
Add the formatting part to a utility method maybe?
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
}
@Override
+
+ public String getOmRatisRoles() {
+ List<ServiceInfo> serviceList = null;
+ StringBuilder sb = new StringBuilder();
+ try {
+ serviceList = getServiceList();
+ } catch (IOException e) {
+ return "";
Review Comment:
Please print a meaningful error LOG message here instead of returning an
empty string
##########
hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html:
##########
@@ -22,6 +22,18 @@ <h2>Status</h2>
<td>Rpc port</td>
<td>{{$ctrl.overview.jmx.RpcPort}}</td>
</tr>
+ <tr>
+ <td>OM Roles (HA) </td>
+ <td>{{$ctrl.overview.jmx.OmRatisRoles}}</td>
+ </tr>
+ <tr>
+ <td>Current-Host</td>
Review Comment:
Can remove current host field
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2966,6 +2967,40 @@ public String getRpcPort() {
}
@Override
+
+ public String getOmRatisRoles() {
+ List<ServiceInfo> serviceList = null;
+ StringBuilder sb = new StringBuilder();
+ try {
+ serviceList = getServiceList();
+ } catch (IOException e) {
+ return "";
+ }
+ for (ServiceInfo info : serviceList) {
+ if (info.getOmRoleInfo() != null) {
+ sb.append(
+ String.format(
+ "{ HostName: %s, Ratis Port: %s, Node-Id: %s, Role: %s } ",
+ info.getHostname(),
+ info.getPort(ServicePort.Type.RATIS),
+ info.getOmRoleInfo().getNodeId(),
+ info.getOmRoleInfo().getServerRole()
+ ));
+ }
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public String getCurrentHost() {
Review Comment:
I don’t think we need to add the hostname, Without knowing the hostname you
wouldn’t be able to access UI itself.
--
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]