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@1499060 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4dfb79652d
commit
b6b61de0d7
|
@ -57,6 +57,34 @@ ServerManager serverManager = master.getServerManager();
|
||||||
AssignmentManager assignmentManager = master.getAssignmentManager();
|
AssignmentManager assignmentManager = master.getAssignmentManager();
|
||||||
</%java>
|
</%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]>
|
<!--[if IE]>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
@ -211,7 +239,8 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Zookeeper Quorum</td>
|
<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>
|
<td>Addresses of all registered ZK servers. For more, see <a href="/zk.jsp">zk dump</a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in New Issue