diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon index a7e91d9b00b..10d87823ed8 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon @@ -35,6 +35,9 @@ HMaster master; org.apache.hadoop.hbase.util.VersionInfo; org.apache.hadoop.hbase.util.Pair; org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix; + org.apache.hadoop.hbase.net.Address; + org.apache.hadoop.hbase.rsgroup.RSGroupInfo; + org.apache.hadoop.hbase.rsgroup.RSGroupUtil; <%if (servers != null && servers.size() > 0)%> @@ -91,6 +94,11 @@ Arrays.sort(serverNames); Version Requests Per Second Num. Regions + <%if !master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null %> + <%if RSGroupUtil.isRSGroupEnabled(master.getConfiguration()) %> + RSGroup + + @@ -101,6 +109,16 @@ Arrays.sort(serverNames); String state = "Normal"; String masterVersion = VersionInfo.getVersion(); Set decommissionedServers = new HashSet<>(master.listDecommissionedRegionServers()); + String rsGroupName = "default"; + List groups; + Map server2GroupMap = new HashMap<>(); + if (!master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null + && RSGroupUtil.isRSGroupEnabled(master.getConfiguration())) { + groups = master.getRSGroupInfoManager().listRSGroups(); + groups.forEach(group -> { + group.getServers().forEach(address -> server2GroupMap.put(address, group)); + }); + } for (ServerName serverName: serverNames) { if (decommissionedServers.contains(serverName)) { state = "Decommissioned"; @@ -123,6 +141,10 @@ Arrays.sort(serverNames); lastContact = (System.currentTimeMillis() - sl.getReportTimestamp())/1000; } long startcode = serverName.getStartcode(); + if (!master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null + && RSGroupUtil.isRSGroupEnabled(master.getConfiguration())) { + rsGroupName = server2GroupMap.get(serverName.getAddress()).getName(); + } <& serverNameLink; serverName=serverName; &> @@ -132,6 +154,11 @@ Arrays.sort(serverNames); <% version %> <% String.format("%,.0f", requestsPerSecond) %> <% String.format("%,d", numRegionsOnline) %> + <%if !master.isInMaintenanceMode() && master.getMasterCoprocessorHost() != null %> + <%if RSGroupUtil.isRSGroupEnabled(master.getConfiguration()) %> + <% rsGroupName %> + + <%java> }