hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject hbase git commit: HBASE-13534 Changed Master UI to promptly display if it is a backup master. (Apekshit)
Date Sat, 25 Apr 2015 16:56:51 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 7c7c4c88f -> 58a3a97cf


HBASE-13534 Changed Master UI to promptly display if it is a backup master. (Apekshit)

Signed-off-by: Elliott Clark <eclark@apache.org>

Amending-Author: Andrew Purtell <apurtell@apache.org>

Conflicts:
	hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterStatusTmpl.jamon


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/58a3a97c
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/58a3a97c
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/58a3a97c

Branch: refs/heads/0.98
Commit: 58a3a97cfd7be5f383cf56a3004ab91922647405
Parents: 7c7c4c8
Author: Apekshit(Appy) Sharma <appy@cloudera.com>
Authored: Wed Apr 22 20:28:14 2015 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Sat Apr 25 09:41:29 2015 -0700

----------------------------------------------------------------------
 .../tmpl/master/BackupMasterStatusTmpl.jamon    | 47 ++++++++++----------
 .../hbase/tmpl/master/MasterStatusTmpl.jamon    |  5 ++-
 2 files changed, 27 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/58a3a97c/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterStatusTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterStatusTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterStatusTmpl.jamon
index 64b5f2e..8e8ff40 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterStatusTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterStatusTmpl.jamon
@@ -24,30 +24,26 @@ java.util.*;
 org.apache.hadoop.hbase.ServerName;
 org.apache.hadoop.hbase.ClusterStatus;
 org.apache.hadoop.hbase.master.HMaster;
+org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
 </%import>
 <%java>
-Collection<ServerName> masters = null;
-
-if (master.isActiveMaster()) {
-  ClusterStatus status = master.getClusterStatus();
-  masters = status.getBackupMasters();
-} else{
-  ServerName sn = master.getMasterAddressTracker().getMasterAddress();
-  assert sn != null : "Failed to retreive master's ServerName!";
-  masters = Collections.singletonList(sn);
-}
+MasterAddressTracker masterAddressTracker = master.getMasterAddressTracker();
 </%java>
 
-<%java>
-ServerName [] serverNames = masters.toArray(new ServerName[masters.size()]);
-</%java>
 <%if (!master.isActiveMaster()) %>
-    <%if serverNames[0] != null %>
-        <h2>Master</h2>
-        <a href="//<% serverNames[0].getHostname() %>:<% master.getConfiguration().getInt("hbase.master.info.port",
60010) %>/master-status" target="_blank"><% serverNames[0].getHostname() %></a>
-    <%else>
-        Unable to parse master hostname.
-    </%if>
+    <%java>
+    ServerName active_master =
+        (masterAddressTracker == null) ? null : masterAddressTracker.getMasterAddress();
+    assert active_master != null : "Failed to retrieve master's ServerName!";
+    int infoPort = master.getConfiguration().getInt("hbase.master.info.port", 60010);
+    </%java>
+    <div class="row inner_header">
+        <div class="page-header">
+            <h1>Backup Master <small><% master.getServerName().getHostname()
%></small></h1>
+        </div>
+    </div>
+    <h4>Current Active Master: <a href="//<% active_master.getHostname() %>:<%
infoPort %>/master-status"
+        target="_blank"><% active_master.getHostname() %></a><h4>
 <%else>
     <h2>Backup Masters</h2>
 
@@ -58,17 +54,22 @@ ServerName [] serverNames = masters.toArray(new ServerName[masters.size()]);
         <th>Start Time</th>
     </tr>
     <%java>
-    Arrays.sort(serverNames);
-    for (ServerName serverName : serverNames) {
+    Collection<ServerName> backup_masters = master.getClusterStatus().getBackupMasters();
+    ServerName [] backupServerNames = backup_masters.toArray(new ServerName[backup_masters.size()]);
+    Arrays.sort(backupServerNames);
+    for (ServerName serverName : backupServerNames) {
+      int infoPort = master.getConfiguration().getInt("hbase.master.info.port", 60010);
     </%java>
     <tr>
-        <td><a href="//<% serverName.getHostname() %>:<% master.getConfiguration().getInt("hbase.master.info.port",
60010) %>/master-status" target="_blank"><% serverName.getHostname() %></a></td>
+        <td><a href="//<% serverName.getHostname() %>:<% infoPort %>/master-status"
+            target="_blank"><% serverName.getHostname() %></a>
+        </td>
         <td><% serverName.getPort() %></td>
         <td><% new Date(serverName.getStartcode()) %></td>
     </tr>
     <%java>
     }
     </%java>
-    <tr><td>Total:<% (masters != null) ? masters.size() : 0 %></td>
+    <tr><td>Total:<% backupServerNames.length %></td>
     </table>
 </%if>

http://git-wip-us.apache.org/repos/asf/hbase/blob/58a3a97c/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
index a448ff0..7a808fd 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
@@ -99,7 +99,8 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
 <html lang="en">
   <head>
     <meta charset="utf-8">
-    <title>Master: <% master.getServerName().getHostname() %></title>
+    <title><%if master.isActiveMaster() %>Master: <%else>Backup Master:
</%if>
+    <% master.getServerName().getHostname() %></title>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta name="description" content="">
     <link href="/static/css/bootstrap.min.css" rel="stylesheet">
@@ -139,7 +140,7 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
 	<%if master.isActiveMaster() %>
         <div class="row inner_header">
             <div class="page-header">
-                <h1>Master <small><% master.getServerName().getHostname()
%> </small></h1>
+                <h1>Master <small><% master.getServerName().getHostname()
%></small></h1>
             </div>
         </div>
 


Mime
View raw message