Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,26 @@
import="java.util.Collection"
import="java.util.Date"
import="java.util.List"
import="org.apache.hadoop.fs.FileSystem"
import="org.apache.hadoop.hbase.client.RegionInfo"
import="org.apache.hadoop.hbase.client.RegionInfoDisplay"
import="org.apache.hadoop.hbase.regionserver.HRegionServer"
import="org.apache.hadoop.hbase.regionserver.HStoreFile"
import="org.apache.hadoop.hbase.regionserver.Region"
import="org.apache.hadoop.hbase.regionserver.Store"
import="org.apache.hadoop.hbase.regionserver.StoreFile"
import="org.apache.hadoop.hbase.regionserver.HRegion"
import="org.apache.hadoop.hbase.regionserver.HStore"
%>
<%
String regionName = request.getParameter("name");
HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
FileSystem fs = rs.getFileSystem();

Region region = rs.getRegion(regionName);
HRegion region = rs.getRegion(regionName);
String displayName;
boolean isReplicaRegion = false;
if (region != null) {
displayName = RegionInfoDisplay.getRegionNameAsStringForDisplay(region.getRegionInfo(),
rs.getConfiguration());
isReplicaRegion = region.getRegionInfo().getReplicaId() > RegionInfo.DEFAULT_REPLICA_ID;
} else {
displayName = "region {" + regionName + "} is not currently online on this region server";
}
Expand All @@ -54,10 +58,10 @@
</div>

<% if(region != null) { //
List<? extends Store> stores = region.getStores();
for (Store store : stores) {
List<HStore> stores = region.getStores();
for (HStore store : stores) {
String cf = store.getColumnFamilyName();
Collection<? extends StoreFile> storeFiles = store.getStorefiles(); %>
Collection<HStoreFile> storeFiles = store.getStorefiles(); %>

<h3>Column Family: <%= cf %></h3>

Expand All @@ -73,17 +77,20 @@
<th>Len Of Biggest Cell</th>
<th>Key Of Biggest Cell</th>
</tr>
<% for(StoreFile sf : storeFiles) { %>
<% int count = 0;
for(HStoreFile sf : storeFiles) {
if (isReplicaRegion && !fs.exists(sf.getPath())) continue;
count++; %>
<tr>
<td><a href="storeFile.jsp?name=<%= sf.getEncodedPath() %>"><%= sf.getPath() %></a></td>
<td><%= (int) (rs.getFileSystem().getLength(sf.getPath()) / 1024 / 1024) %></td>
<td><%= (int) (fs.getLength(sf.getPath()) / 1024 / 1024) %></td>
<td><%= new Date(sf.getModificationTimestamp()) %></td>
<td><%= String.format("%,1d", ((HStoreFile)sf).getFileInfo().getHFileInfo().getLenOfBiggestCell()) %></td>
<td><%= ((HStoreFile)sf).getFileInfo().getHFileInfo().getKeyOfBiggestCell() %></td>
<td><%= String.format("%,1d", sf.getFileInfo().getHFileInfo().getLenOfBiggestCell()) %></td>
<td><%= sf.getFileInfo().getHFileInfo().getKeyOfBiggestCell() %></td>
</tr>
<% } %>

<p> <%= storeFiles.size() %> StoreFile(s) in set.</p>
<p> <%= count %> StoreFile(s) in set. <%= isReplicaRegion ? "The information about storefile(s) may not up-to-date because it's not the primary region." : "" %></p>
</table>
<% }
}%>
Expand Down