HBASE-6367 List backup masters in ui.
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1419787 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8c61fe6364
commit
930fd35848
|
@ -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>
|
||||
|
||||
|
||||
|
||||
|
|
@ -134,6 +134,8 @@ org.apache.hadoop.hbase.HBaseConfiguration;
|
|||
<& deadRegionServers &>
|
||||
</%if>
|
||||
|
||||
<h2>Backup Masters</h2>
|
||||
<& BackupMasterListTmpl; master = master &>
|
||||
|
||||
<h2>Tables</h2>
|
||||
<div class="tabbable">
|
||||
|
|
Loading…
Reference in New Issue