You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by en...@apache.org on 2012/12/10 22:27:51 UTC

svn commit: r1419787 - in /hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master: BackupMasterListTmpl.jamon MasterStatusTmpl.jamon

Author: enis
Date: Mon Dec 10 21:27:50 2012
New Revision: 1419787

URL: http://svn.apache.org/viewvc?rev=1419787&view=rev
Log:
HBASE-6367 List backup masters in ui.

Added:
    hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterListTmpl.jamon
Modified:
    hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon

Added: hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterListTmpl.jamon
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterListTmpl.jamon?rev=1419787&view=auto
==============================================================================
--- hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterListTmpl.jamon (added)
+++ hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterListTmpl.jamon Mon Dec 10 21:27:50 2012
@@ -0,0 +1,69 @@
+<%doc>
+Copyright The Apache Software Foundation
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+ </%doc>
+
+<%args>
+HMaster master;
+</%args>
+
+<%import>
+        java.util.*;
+        org.apache.hadoop.util.StringUtils;
+        org.apache.hadoop.hbase.util.Bytes;
+        org.apache.hadoop.hbase.master.HMaster;
+        org.apache.hadoop.hbase.HConstants;
+        org.apache.hadoop.hbase.ServerName;
+        org.apache.hadoop.hbase.ClusterStatus;
+</%import>
+
+<%java>
+Collection<ServerName> backupMasters = null;
+if (master.isActiveMaster()) {
+    ClusterStatus status = master.getClusterStatus();
+    backupMasters = status.getBackupMasters();
+}
+</%java>
+
+<table class="table table-striped">
+<%if (backupMasters != null && backupMasters.size() > 0)%>
+<tr>
+    <th>ServerName</th>
+    <th>Port</th>
+    <th>Start Time</th>
+</tr>
+<%java>
+    ServerName [] serverNames = backupMasters.toArray(new ServerName[backupMasters.size()]);
+    Arrays.sort(serverNames);
+    for (ServerName serverName: serverNames) {
+</%java>
+<tr>
+    <td><% serverName.getHostname() %></td>
+    <td><% serverName.getPort() %></td>
+    <td><% new Date(serverName.getStartcode()) %></td>
+</tr>
+<%java>
+    }
+</%java>
+</%if>
+<tr><td>Total:<% (backupMasters != null) ? backupMasters.size() : 0 %></td>
+</table>
+
+
+
+

Modified: hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon?rev=1419787&r1=1419786&r2=1419787&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon (original)
+++ hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon Mon Dec 10 21:27:50 2012
@@ -134,6 +134,8 @@ org.apache.hadoop.hbase.HBaseConfigurati
             <& deadRegionServers &>
         </%if>
 
+        <h2>Backup Masters</h2>
+        <& BackupMasterListTmpl; master = master &>
 
         <h2>Tables</h2>
         <div class="tabbable">