HBASE-24653 Show snapshot owner on Master WebUI (#2016)

Signed-off-by: Guanghao Zhang <zghao@apache.org>
This commit is contained in:
niuyulin 2020-07-10 15:03:05 +08:00 committed by GitHub
parent 1d0e285a6f
commit 5de1dff8f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -60,6 +60,7 @@ org.apache.hadoop.hbase.tool.CanaryTool;
org.apache.hadoop.hbase.util.Bytes;
org.apache.hadoop.hbase.util.CommonFSUtils;
org.apache.hadoop.hbase.util.JvmVersion;
org.apache.hadoop.hbase.util.PrettyPrinter;
org.apache.hadoop.util.StringUtils;
</%import>
@ -663,6 +664,8 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
<th>Snapshot Name</th>
<th>Table</th>
<th>Creation Time</th>
<th>Owner</th>
<th>TTL</th>
</tr>
<%for SnapshotDescription snapshotDesc : snapshots%>
<%java>
@ -673,6 +676,11 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
<td><a href="table.jsp?name=<% snapshotTable.getNameAsString() %>"><% snapshotTable.getNameAsString() %></a>
</td>
<td><% new Date(snapshotDesc.getCreationTime()) %></td>
<td><% snapshotDesc.getOwner() %></td>
<td>
<% snapshotDesc.getTtl() == 0 ? "FOREVER": PrettyPrinter.format(String.valueOf(snapshotDesc.getTtl()), PrettyPrinter.Unit.TIME_INTERVAL) %>
</td>
</tr>
</%for>
<p><% snapshots.size() %> snapshot(s) in set. [<a href="/snapshotsStats.jsp">Snapshot Storefile stats</a>]</p>

View File

@ -30,6 +30,7 @@
import="org.apache.hadoop.util.StringUtils"
import="org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription"
%>
<%@ page import="org.apache.hadoop.hbase.util.PrettyPrinter" %>
<%
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
Configuration conf = master.getConfiguration();
@ -65,7 +66,8 @@
<th>Snapshot Name</th>
<th>Table</th>
<th>Creation Time</th>
<th>TTL(Sec)</th>
<th>Owner</th>
<th>TTL</th>
<th>Shared Storefile Size</th>
<th>Mob Storefile Size</th>
<th>Archived Storefile Size</th>
@ -83,11 +85,13 @@
<td><a href="/table.jsp?name=<%= snapshotTable.getNameAsString() %>">
<%= snapshotTable.getNameAsString() %></a></td>
<td><%= new Date(snapshotDesc.getCreationTime()) %></td>
<td><%= snapshotDesc.getOwner() %></td>
<td>
<% if (snapshotDesc.getTtl() == 0) { %>
FOREVER
FOREVER
<% } else { %>
<%= snapshotDesc.getTtl() %>
<%=PrettyPrinter
.format(String.valueOf(snapshotDesc.getTtl()), PrettyPrinter.Unit.TIME_INTERVAL)%>
<% } %>
</td>
<td><%= StringUtils.humanReadableInt(stats.getSharedStoreFilesSize()) %></td>