From d9c1902d889941037437b5f28baddebd7cadf71c Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Mon, 18 Sep 2023 19:10:14 +0530 Subject: [PATCH 01/13] HDDS-9303. Ozone Manager : Add Ozone leader information on the Ozone manager UI --- .../main/resources/webapps/static/ozone.css | 8 +++++ .../java/org/apache/hadoop/ozone/OmUtils.java | 35 +++++++++---------- .../org/apache/hadoop/ozone/om/OMMXBean.java | 4 ++- .../apache/hadoop/ozone/om/OzoneManager.java | 11 +++--- .../webapps/ozoneManager/om-overview.html | 25 ++++++++++++- 5 files changed, 57 insertions(+), 26 deletions(-) diff --git a/hadoop-hdds/framework/src/main/resources/webapps/static/ozone.css b/hadoop-hdds/framework/src/main/resources/webapps/static/ozone.css index 8b5ae508e47..bb8dbe6a0b1 100644 --- a/hadoop-hdds/framework/src/main/resources/webapps/static/ozone.css +++ b/hadoop-hdds/framework/src/main/resources/webapps/static/ozone.css @@ -87,3 +87,11 @@ body { word-wrap: break-word; table-layout: fixed; } + +.om-roles-css { + margin-bottom: 1px !important; +} + +.om-roles-background { + background-color: #dcfbcd!important; +} diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index c7cb996fdc4..201180ed6d3 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -813,9 +813,8 @@ public static boolean isBucketSnapshotIndicator(String key) { return key.startsWith(OM_SNAPSHOT_INDICATOR) && key.split("/").length == 2; } - public static String format(List nodes, int port, - String leaderId) { - StringBuilder sb = new StringBuilder(); + public static List> format(List nodes, int port, String leaderId) { + List> omInfoList = new ArrayList<>(); // Ensuring OM's are printed in correct order List omNodes = nodes.stream() .filter(node -> node.getNodeType() == HddsProtos.NodeType.OM) @@ -825,26 +824,24 @@ public static String format(List 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"; + Map omInfo = new HashMap<>(); + omInfo.put("HostName", info.getHostname()); + omInfo.put("Node-Id", info.getOmRoleInfo().getNodeId()); + omInfo.put("Ratis-Port", String.valueOf(port)); + omInfo.put("Role", role); + + omInfoList.add(omInfo); count++; } } // Print Stand-alone if only one OM exists - if (count == 1) { - return "STANDALONE"; - } else { - return sb.toString(); - } + if (count == 1) { + // Return an empty list to indicate "STANDALONE" + return Collections.emptyList(); + } else { + return omInfoList; + } } /** diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java index 791379bdc86..9c306dccbfc 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java +++ b/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; /** * This is the JMX management interface for OM information. @@ -29,7 +31,7 @@ public interface OMMXBean extends ServiceRuntimeInfo { String getRpcPort(); - String getRatisRoles(); + List> getRatisRoles(); String getRatisLogDirectory(); diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java index e67f4e505ce..798029cb1ef 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java @@ -3010,7 +3010,7 @@ public String getRpcPort() { } @Override - public String getRatisRoles() { + public List> getRatisRoles() { List serviceList; int port = omNodeDetails.getRatisPort(); RaftPeer leaderId; @@ -3019,16 +3019,17 @@ 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"; + } + else { + return Collections.emptyList(); } } diff --git a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html index 3e2eb170997..72ca7ff0945 100644 --- a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html +++ b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html @@ -28,7 +28,30 @@

Status

OM Roles (HA) - {{$ctrl.overview.jmx.RatisRoles}} + + + + + + + + + + + + + + + + + + + + + + + +
Host NameNode IDRatis PortRole
{{roles[3].value}}{{roles[2].value}}{{roles[1].value}}{{roles[0].value}}
{{roles[3].value}}{{roles[2].value}}{{roles[1].value}}{{roles[0].value}}
Current-Role From ba23f0b74f2cf794c91d71647403f1c4360b4832 Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Thu, 21 Sep 2023 10:31:38 +0530 Subject: [PATCH 02/13] HDDS-9303. Ozone Manager : Display leader information in tanle format and highlight current node --- .../java/org/apache/hadoop/ozone/OmUtils.java | 42 +++++++------- .../apache/hadoop/ozone/om/OzoneManager.java | 3 +- .../webapps/ozoneManager/om-overview.html | 56 ++++++++++--------- 3 files changed, 51 insertions(+), 50 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index 201180ed6d3..b77d6c20418 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -821,27 +821,27 @@ public static List> format(List nodes, int port .sorted(Comparator.comparing(ServiceInfo::getHostname)) .collect(Collectors.toList()); int count = 0; - 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"; - Map omInfo = new HashMap<>(); - omInfo.put("HostName", info.getHostname()); - omInfo.put("Node-Id", info.getOmRoleInfo().getNodeId()); - omInfo.put("Ratis-Port", String.valueOf(port)); - omInfo.put("Role", role); - - omInfoList.add(omInfo); - count++; - } - } - // Print Stand-alone if only one OM exists - if (count == 1) { - // Return an empty list to indicate "STANDALONE" - return Collections.emptyList(); - } else { - return omInfoList; - } + 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"; + Map omInfo = new HashMap<>(); + omInfo.put("HostName", info.getHostname()); + omInfo.put("Node-Id", info.getOmRoleInfo().getNodeId()); + omInfo.put("Ratis-Port", String.valueOf(port)); + omInfo.put("Role", role); + + omInfoList.add(omInfo); + count++; + } + } + // Print Stand-alone if only one OM exists + if (count == 1) { + // Return an empty list to indicate "STANDALONE" + return Collections.emptyList(); + } else { + return omInfoList; + } } /** diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java index 798029cb1ef..3900de35461 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java @@ -3027,8 +3027,7 @@ public List> getRatisRoles() { return Collections.emptyList(); } return OmUtils.format(serviceList, port, leaderId.getId().toString()); - } - else { + } else { return Collections.emptyList(); } } diff --git a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html index 72ca7ff0945..e1e26270c9e 100644 --- a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html +++ b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html @@ -26,33 +26,6 @@

Status

OM Id {{$ctrl.role.Id}} - - OM Roles (HA) - - - - - - - - - - - - - - - - - - - - - - - -
Host NameNode IDRatis PortRole
{{roles[3].value}}{{roles[2].value}}{{roles[1].value}}{{roles[0].value}}
{{roles[3].value}}{{roles[2].value}}{{roles[1].value}}{{roles[0].value}}
- Current-Role {{$ctrl.role.Role}} @@ -72,6 +45,35 @@

Status

+
+

OM Roles (HA)

+ + + + + + + + + + + + + + + + + + + + + + + +
Host NameNode IDRatis PortRole
{{roles[3].value}}{{roles[2].value}}{{roles[1].value}}{{roles[0].value}}
{{roles[3].value}}{{roles[2].value}}{{roles[1].value}}{{roles[0].value}}
+
+

Meta-Data Volume Information

From 1d866ce25bf1a4f4a0c118819ca798739af387d9 Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Thu, 21 Sep 2023 12:20:57 +0530 Subject: [PATCH 03/13] HDDS-9303. Ozone Manager : Display leader information in tanle format and highlight current node CSS removal --- .../framework/src/main/resources/webapps/static/ozone.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hadoop-hdds/framework/src/main/resources/webapps/static/ozone.css b/hadoop-hdds/framework/src/main/resources/webapps/static/ozone.css index bb8dbe6a0b1..373626e026f 100644 --- a/hadoop-hdds/framework/src/main/resources/webapps/static/ozone.css +++ b/hadoop-hdds/framework/src/main/resources/webapps/static/ozone.css @@ -88,10 +88,6 @@ body { table-layout: fixed; } -.om-roles-css { - margin-bottom: 1px !important; -} - .om-roles-background { background-color: #dcfbcd!important; } From 342ae8ec8fd315020a76c5d8bc18d136507ad2a1 Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Mon, 23 Oct 2023 15:13:11 +0530 Subject: [PATCH 04/13] HDDS-9303. Ozone Manager : Display leader information in table format and highlight current node. Review Comments --- .../java/org/apache/hadoop/ozone/OmUtils.java | 15 +++++---------- .../org/apache/hadoop/ozone/om/OzoneManager.java | 14 +++++++++++--- .../webapps/ozoneManager/om-overview.html | 11 +++++------ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index b77d6c20418..360854b5d94 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -826,22 +826,17 @@ public static List> format(List nodes, int port if (info.getNodeType() == HddsProtos.NodeType.OM) { String role = info.getOmRoleInfo().getNodeId().equals(leaderId) ? "LEADER" : "FOLLOWER"; Map omInfo = new HashMap<>(); - omInfo.put("HostName", info.getHostname()); - omInfo.put("Node-Id", info.getOmRoleInfo().getNodeId()); - omInfo.put("Ratis-Port", String.valueOf(port)); - omInfo.put("Role", role); + omInfo.put("hostName", info.getHostname()); + omInfo.put("nodeId", info.getOmRoleInfo().getNodeId()); + omInfo.put("ratisPort", String.valueOf(port)); + omInfo.put("role", role); omInfoList.add(omInfo); count++; } } - // Print Stand-alone if only one OM exists - if (count == 1) { - // Return an empty list to indicate "STANDALONE" - return Collections.emptyList(); - } else { + // Return omInfoList if count ==1 or count >=1 return omInfoList; - } } /** diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java index 3900de35461..12c8aef5a24 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java @@ -3012,6 +3012,8 @@ public String getRpcPort() { @Override public List> getRatisRoles() { List serviceList; + List> resultList = new ArrayList<>(); + Map messageException = new HashMap<>(); int port = omNodeDetails.getRatisPort(); RaftPeer leaderId; if (isRatisEnabled) { @@ -3019,16 +3021,22 @@ public List> getRatisRoles() { leaderId = omRatisServer.getLeader(); if (leaderId == null) { LOG.error("No leader found"); - return Collections.emptyList(); + messageException.put("Message", "Exception: Not a leader"); + resultList.add(messageException); + return resultList; } serviceList = getServiceList(); } catch (IOException e) { LOG.error("IO-Exception Occurred", e); - return Collections.emptyList(); + messageException.put("Message", "IO-Exception Occurred"); + resultList.add(messageException); + return resultList; } return OmUtils.format(serviceList, port, leaderId.getId().toString()); } else { - return Collections.emptyList(); + messageException.put("Message", "Exception: Ratis Disabled"); + resultList.add(messageException); + return resultList; } } diff --git a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html index e1e26270c9e..6d51ede410b 100644 --- a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html +++ b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html @@ -56,19 +56,18 @@

OM Roles (HA)

- - + + + - - + + -
Role
{{roles[0].value}} {{roles[3].value}} {{roles[2].value}} {{roles[1].value}}{{roles[0].value}}
{{roles[0].value}} {{roles[3].value}} {{roles[2].value}} {{roles[1].value}}{{roles[0].value}}
From b11bb5b86d4abe47fd7e0f54a776d4ae8e73aef3 Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Thu, 26 Oct 2023 22:36:31 +0530 Subject: [PATCH 05/13] HDDS-9303. Ozone Manager : Display leader information in table format and highlight current node Review Changes --- .../java/org/apache/hadoop/ozone/OmUtils.java | 35 +++++++++---------- .../org/apache/hadoop/ozone/om/OMMXBean.java | 2 +- .../apache/hadoop/ozone/om/OzoneManager.java | 12 +++---- .../webapps/ozoneManager/om-overview.html | 23 ++++++------ 4 files changed, 37 insertions(+), 35 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index 360854b5d94..d8930cc36ee 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -813,30 +813,29 @@ public static boolean isBucketSnapshotIndicator(String key) { return key.startsWith(OM_SNAPSHOT_INDICATOR) && key.split("/").length == 2; } - public static List> format(List nodes, int port, String leaderId) { - List> omInfoList = new ArrayList<>(); + public static List> format(List nodes, int port, String leaderId) { + List> omInfoList = new ArrayList<>(); // Ensuring OM's are printed in correct order List omNodes = nodes.stream() .filter(node -> node.getNodeType() == HddsProtos.NodeType.OM) .sorted(Comparator.comparing(ServiceInfo::getHostname)) .collect(Collectors.toList()); int count = 0; - 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"; - Map omInfo = new HashMap<>(); - omInfo.put("hostName", info.getHostname()); - omInfo.put("nodeId", info.getOmRoleInfo().getNodeId()); - omInfo.put("ratisPort", String.valueOf(port)); - omInfo.put("role", role); - - omInfoList.add(omInfo); - count++; - } - } - // Return omInfoList if count ==1 or count >=1 - return omInfoList; + 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"; + List omInfo = new ArrayList<>(); + omInfo.add(info.getHostname()); + omInfo.add(info.getOmRoleInfo().getNodeId()); + omInfo.add(String.valueOf(port)); + omInfo.add(role); + omInfoList.add(omInfo); + count++; + } + } + // Return omInfoList if count ==1 or count >=1 + return omInfoList; } /** diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java index 9c306dccbfc..69d265194db 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java @@ -31,7 +31,7 @@ public interface OMMXBean extends ServiceRuntimeInfo { String getRpcPort(); - List> getRatisRoles(); + List> getRatisRoles(); String getRatisLogDirectory(); diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java index 12c8aef5a24..f616f7b7c5f 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java @@ -3010,10 +3010,10 @@ public String getRpcPort() { } @Override - public List> getRatisRoles() { + public List> getRatisRoles() { List serviceList; - List> resultList = new ArrayList<>(); - Map messageException = new HashMap<>(); + List> resultList = new ArrayList<>(); + List messageException = new ArrayList<>(); int port = omNodeDetails.getRatisPort(); RaftPeer leaderId; if (isRatisEnabled) { @@ -3021,20 +3021,20 @@ public List> getRatisRoles() { leaderId = omRatisServer.getLeader(); if (leaderId == null) { LOG.error("No leader found"); - messageException.put("Message", "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); - messageException.put("Message", "IO-Exception Occurred"); + messageException.add("IO-Exception Occurred"); resultList.add(messageException); return resultList; } return OmUtils.format(serviceList, port, leaderId.getId().toString()); } else { - messageException.put("Message", "Exception: Ratis Disabled"); + messageException.add("Ratis Disabled"); resultList.add(messageException); return resultList; } diff --git a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html index 6d51ede410b..7b6f234a6c8 100644 --- a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html +++ b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html @@ -45,6 +45,8 @@

Status

+

Exception: {{$ctrl.overview.jmx.RatisRoles[0]}}

+

OM Roles (HA)

@@ -57,21 +59,22 @@

OM Roles (HA)

- - - - - + + + + + - - - - - + + + + +
{{roles[0].value}}{{roles[3].value}}{{roles[2].value}}{{roles[1].value}}
{{roles[0]}}{{roles[1]}}{{roles[2]}}{{roles[3]}}
{{roles[0].value}}{{roles[3].value}}{{roles[2].value}}{{roles[1].value}}
{{roles[0]}}{{roles[1]}}{{roles[2]}}{{roles[3]}}
+

Meta-Data Volume Information

From a16bf039d8b5a8731945c9b1a4bd5be030d8cf8b Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Fri, 3 Nov 2023 22:58:57 +0530 Subject: [PATCH 06/13] HDDS-9303. Ozone Manager : Display leader information in table format and highlight current node --- .../src/main/java/org/apache/hadoop/ozone/OmUtils.java | 1 - .../main/resources/webapps/ozoneManager/om-overview.html | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index d8930cc36ee..23a3d067f8f 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -834,7 +834,6 @@ public static List> format(List nodes, int port, Strin count++; } } - // Return omInfoList if count ==1 or count >=1 return omInfoList; } diff --git a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html index 7b6f234a6c8..286d8ee5d72 100644 --- a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html +++ b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html @@ -45,9 +45,8 @@

Status

-

Exception: {{$ctrl.overview.jmx.RatisRoles[0]}}

-
-
+

Exception: {{$ctrl.overview.jmx.RatisRoles[0]}}

+

OM Roles (HA)

@@ -74,7 +73,7 @@

OM Roles (HA)

-
+

Meta-Data Volume Information

From c47bae6fbc9bc8927fbfbd54f715e781ae9a9d03 Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Mon, 6 Nov 2023 22:47:30 +0530 Subject: [PATCH 07/13] HDDS-9303. Ozone Manager : Display leader information in table format and highlight current node.Review Changes --- .../common/src/main/java/org/apache/hadoop/ozone/OmUtils.java | 2 +- .../src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java | 1 - .../src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index 23a3d067f8f..12d33c3c506 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -812,7 +812,7 @@ public static String getOMAddressListPrintString(List omList) { public static boolean isBucketSnapshotIndicator(String key) { return key.startsWith(OM_SNAPSHOT_INDICATOR) && key.split("/").length == 2; } - + public static List> format(List nodes, int port, String leaderId) { List> omInfoList = new ArrayList<>(); // Ensuring OM's are printed in correct order diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java index 69d265194db..54e81f8825d 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMXBean.java @@ -21,7 +21,6 @@ import org.apache.hadoop.hdds.annotation.InterfaceAudience; import org.apache.hadoop.hdds.server.ServiceRuntimeInfo; import java.util.List; -import java.util.Map; /** * This is the JMX management interface for OM information. diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java index f616f7b7c5f..66913826459 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java @@ -3028,7 +3028,7 @@ public List> getRatisRoles() { serviceList = getServiceList(); } catch (IOException e) { LOG.error("IO-Exception Occurred", e); - messageException.add("IO-Exception Occurred"); + messageException.add("IO-Exception Occurred, " + e.getMessage()); resultList.add(messageException); return resultList; } From b5c0712f403e0b32df6be948e847eb28c1263d52 Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Mon, 27 Nov 2023 16:45:44 +0530 Subject: [PATCH 08/13] HDDS-9303. Ozone Manager : Display leader information in table format and highlight current node Review Change --- .../src/main/resources/webapps/ozoneManager/om-overview.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html index 286d8ee5d72..09df5f9718e 100644 --- a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html +++ b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html @@ -45,9 +45,9 @@

Status

+

OM Roles (HA)

Exception: {{$ctrl.overview.jmx.RatisRoles[0]}}

-

OM Roles (HA)

From 120c4418923c9a2a3191eb6c9cea37060aefd3d8 Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Mon, 27 Nov 2023 19:25:24 +0530 Subject: [PATCH 09/13] HDDS-9303. Display leader in table and highlight current node in OM web UI CheckStle Issue Solved --- .../src/main/java/org/apache/hadoop/ozone/OmUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index 12d33c3c506..805ecd2870e 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -813,7 +813,8 @@ public static boolean isBucketSnapshotIndicator(String key) { return key.startsWith(OM_SNAPSHOT_INDICATOR) && key.split("/").length == 2; } - public static List> format(List nodes, int port, String leaderId) { + public static List> format(List nodes, + int port, String leaderId) { List> omInfoList = new ArrayList<>(); // Ensuring OM's are printed in correct order List omNodes = nodes.stream() @@ -824,7 +825,8 @@ public static List> format(List nodes, int port, Strin 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"; + String role = info.getOmRoleInfo().getNodeId().equals(leaderId) + ? "LEADER" : "FOLLOWER"; List omInfo = new ArrayList<>(); omInfo.add(info.getHostname()); omInfo.add(info.getOmRoleInfo().getNodeId()); From 959e814beb7b1a65a17a52621a9978d844dd8a52 Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Mon, 27 Nov 2023 20:24:50 +0530 Subject: [PATCH 10/13] HDDS-9303. Display leader in table and highlight current node in OM web UI CheckStle Issue --- .../common/src/main/java/org/apache/hadoop/ozone/OmUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index 805ecd2870e..c12b7feb31a 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -813,8 +813,8 @@ public static boolean isBucketSnapshotIndicator(String key) { return key.startsWith(OM_SNAPSHOT_INDICATOR) && key.split("/").length == 2; } - public static List> format(List nodes, - int port, String leaderId) { + public static List> format( + List nodes, int port, String leaderId) { List> omInfoList = new ArrayList<>(); // Ensuring OM's are printed in correct order List omNodes = nodes.stream() From d5c848ea010db78dab3ae01b9b148dd583e6af6f Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Wed, 29 Nov 2023 19:17:01 +0530 Subject: [PATCH 11/13] HDDS-9303. Display leader in table and highlight current node in OM web UI Review --- .../common/src/main/java/org/apache/hadoop/ozone/OmUtils.java | 2 -- .../src/main/resources/webapps/ozoneManager/om-overview.html | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index c12b7feb31a..f017116ac28 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -821,7 +821,6 @@ public static List> format( .filter(node -> node.getNodeType() == HddsProtos.NodeType.OM) .sorted(Comparator.comparing(ServiceInfo::getHostname)) .collect(Collectors.toList()); - int count = 0; for (ServiceInfo info : omNodes) { // Printing only the OM's running if (info.getNodeType() == HddsProtos.NodeType.OM) { @@ -833,7 +832,6 @@ public static List> format( omInfo.add(String.valueOf(port)); omInfo.add(role); omInfoList.add(omInfo); - count++; } } return omInfoList; diff --git a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html index 09df5f9718e..7a1aa67d822 100644 --- a/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html +++ b/hadoop-ozone/ozone-manager/src/main/resources/webapps/ozoneManager/om-overview.html @@ -46,7 +46,7 @@

Status

OM Roles (HA)

-

Exception: {{$ctrl.overview.jmx.RatisRoles[0]}}

+

{{$ctrl.overview.jmx.RatisRoles[0][0]}}

From 819fbe0fcecfe10181113afc9b958ab63626769e Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Sat, 2 Dec 2023 11:23:56 +0530 Subject: [PATCH 12/13] HDDS-9303. Display leader in table and highlight current node in OM web UI code formatting --- .../src/main/java/org/apache/hadoop/ozone/OmUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index f017116ac28..57cbdc656f1 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -814,13 +814,13 @@ public static boolean isBucketSnapshotIndicator(String key) { } public static List> format( - List nodes, int port, String leaderId) { + List nodes, int port, String leaderId) { List> omInfoList = new ArrayList<>(); // Ensuring OM's are printed in correct order List omNodes = nodes.stream() - .filter(node -> node.getNodeType() == HddsProtos.NodeType.OM) - .sorted(Comparator.comparing(ServiceInfo::getHostname)) - .collect(Collectors.toList()); + .filter(node -> node.getNodeType() == HddsProtos.NodeType.OM) + .sorted(Comparator.comparing(ServiceInfo::getHostname)) + .collect(Collectors.toList()); for (ServiceInfo info : omNodes) { // Printing only the OM's running if (info.getNodeType() == HddsProtos.NodeType.OM) { From 89b1c07f306d9d4ede735ef7f2b9f9e5cc5754ce Mon Sep 17 00:00:00 2001 From: smitajoshi Date: Mon, 4 Dec 2023 16:18:13 +0530 Subject: [PATCH 13/13] HDDS-9303. Display leader in table and highlight current node in OM web UI --- .../src/main/java/org/apache/hadoop/ozone/OmUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java index 57cbdc656f1..2affe80a858 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java @@ -818,9 +818,9 @@ public static List> format( List> omInfoList = new ArrayList<>(); // Ensuring OM's are printed in correct order List omNodes = nodes.stream() - .filter(node -> node.getNodeType() == HddsProtos.NodeType.OM) - .sorted(Comparator.comparing(ServiceInfo::getHostname)) - .collect(Collectors.toList()); + .filter(node -> node.getNodeType() == HddsProtos.NodeType.OM) + .sorted(Comparator.comparing(ServiceInfo::getHostname)) + .collect(Collectors.toList()); for (ServiceInfo info : omNodes) { // Printing only the OM's running if (info.getNodeType() == HddsProtos.NodeType.OM) {