hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1499057 - /hbase/branches/0.95/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
Date Tue, 02 Jul 2013 18:51:17 GMT
Author: stack
Date: Tue Jul  2 18:51:17 2013
New Revision: 1499057

URL: http://svn.apache.org/r1499057
Log:
HBASE-8812 Avoid a wide line on the HMaster webUI if we have many ZooKeeper servers

Modified:
    hbase/branches/0.95/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon

Modified: hbase/branches/0.95/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon?rev=1499057&r1=1499056&r2=1499057&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
(original)
+++ hbase/branches/0.95/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
Tue Jul  2 18:51:17 2013
@@ -57,6 +57,34 @@ ServerManager serverManager = master.get
 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 = ma
                 </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>



Mime
View raw message