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 f5fa3de937b..9d5c2f90be0 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 @@ -27,32 +27,23 @@ org.apache.hadoop.hbase.master.HMaster; org.apache.hadoop.hbase.zookeeper.MasterAddressTracker; <%java> -Collection masters = null; MasterAddressTracker masterAddressTracker = master.getMasterAddressTracker(); -if (master.isActiveMaster()) { - ClusterStatus status = master.getClusterStatus(); - masters = status.getBackupMasters(); -} else{ - ServerName sn = masterAddressTracker == null ? null - : masterAddressTracker.getMasterAddress(); - assert sn != null : "Failed to retreive master's ServerName!"; - masters = Collections.singletonList(sn); -} -<%java> -ServerName [] serverNames = masters.toArray(new ServerName[masters.size()]); -int infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getMasterInfoPort(); - <%if (!master.isActiveMaster()) %> - <%if serverNames[0] != null %> -

Master

- <% - serverNames[0].getHostname() %> - <%else> - Unable to parse master hostname. - + <%java> + ServerName active_master = + (masterAddressTracker == null) ? null : masterAddressTracker.getMasterAddress(); + assert active_master != null : "Failed to retrieve master's ServerName!"; + int infoPort = (masterAddressTracker == null) ? 0 : masterAddressTracker.getMasterInfoPort(); + +
+ +
+

Current Active Master: <% active_master.getHostname() %>

<%else>

Backup Masters

@@ -63,14 +54,16 @@ int infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getMaster Start Time <%java> - Arrays.sort(serverNames); - for (ServerName serverName : serverNames) { - infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getBackupMasterInfoPort(serverName); + Collection backup_masters = master.getClusterStatus().getBackupMasters(); + ServerName [] backupServerNames = backup_masters.toArray(new ServerName[backup_masters.size()]); + Arrays.sort(backupServerNames); + for (ServerName serverName : backupServerNames) { + int infoPort = (masterAddressTracker == null) ? 0 : masterAddressTracker + .getBackupMasterInfoPort(serverName); - <% - serverName.getHostname() %> + <% serverName.getHostname() %> <% serverName.getPort() %> <% new Date(serverName.getStartcode()) %> @@ -78,6 +71,6 @@ int infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getMaster <%java> } - Total:<% (masters != null) ? masters.size() : 0 %> + Total:<% backupServerNames.length %> 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 1c9ad92970d..6d736eb8bb7 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 @@ -98,7 +98,8 @@ AssignmentManager assignmentManager = master.getAssignmentManager(); - Master: <% master.getServerName().getHostname() %> + <%if master.isActiveMaster() %>Master: <%else>Backup Master: </%if> + <% master.getServerName().getHostname() %> @@ -138,7 +139,7 @@ AssignmentManager assignmentManager = master.getAssignmentManager(); <%if master.isActiveMaster() %>