HBASE-21780: Avoid a wide line on the RegionServer webUI for many ZooKeeper servers

Signed-off-by: Peter Somogyi <psomogyi@apache.org>
This commit is contained in:
Sakthi 2019-01-24 21:20:35 -08:00 committed by Peter Somogyi
parent df8fa5ef23
commit 9853f788e8
1 changed files with 30 additions and 1 deletions

View File

@ -51,6 +51,34 @@ org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
: masterAddressTracker.getMasterAddress();
int infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getMasterInfoPort();
</%java>
<%class>
public String formatZKString() {
StringBuilder quorums = new StringBuilder();
String zkQuorum = regionServer.getZooKeeper().getQuorum();
if (null == zkQuorum) {
return quorums.toString();
}
String[] zks = zkQuorum.split(",");
if (zks.length == 0) {
return quorums.toString();
}
for(int i = 0; i < zks.length; ++i) {
quorums.append(zks[i].trim());
if (i != (zks.length - 1)) {
quorums.append("<br/>");
}
}
return quorums.toString();
}
</%class>
<!DOCTYPE html>
<?xml version="1.0" encoding="UTF-8" ?>
<html lang="en">
@ -177,7 +205,8 @@ org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
</tr>
<tr>
<td>ZooKeeper Quorum</td>
<td><% regionServer.getZooKeeper().getQuorum() %></td>
<%escape #n>
<td><% formatZKString() %></td>
<td>Addresses of all registered ZK servers</td>
</tr>
<tr>