HBASE-8812 Avoid a wide line on the HMaster webUI if we have many ZooKeeper servers

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1499056 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2013-07-02 18:50:57 +00:00
parent 4a5fecce88
commit a51ed6e356
1 changed files with 30 additions and 1 deletions

View File

@ -57,6 +57,34 @@ ServerManager serverManager = master.getServerManager();
AssignmentManager assignmentManager = master.getAssignmentManager();
</%java>
<%class>
public String formatZKString() {
StringBuilder quorums = new StringBuilder();
String zkQuorum = master.getZooKeeperWatcher().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()).append(",");
if ((i+1) % 4 == 0 && i != (zks.length - 1)) {
quorums.append("<br/>");
}
}
quorums.setLength(quorums.length() - 1);
return quorums.toString();
}
</%class>
<!--[if IE]>
<!DOCTYPE html>
<![endif]-->
@ -211,7 +239,8 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
</tr>
<tr>
<td>Zookeeper Quorum</td>
<td><% master.getZooKeeperWatcher().getQuorum() %></td>
<%escape #n>
<td> <% formatZKString() %> </td>
<td>Addresses of all registered ZK servers. For more, see <a href="/zk.jsp">zk dump</a>.</td>
</tr>
<tr>