Skip to content

Commit e558fc9

Browse files
committed
HBASE-22096 /storeFile.jsp shows CorruptHFileException when the storeFile is a reference file (#888)
Signed-off-by: Lijin Bin <binlijin@apache.org>
1 parent 71c913f commit e558fc9

File tree

1 file changed

+5
-1
lines changed
  • hbase-server/src/main/resources/hbase-webapps/regionserver

1 file changed

+5
-1
lines changed

hbase-server/src/main/resources/hbase-webapps/regionserver/storeFile.jsp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@
2121
import="java.io.ByteArrayOutputStream"
2222
import="java.io.PrintStream"
2323
import="org.apache.hadoop.conf.Configuration"
24+
import="org.apache.hadoop.fs.FileSystem"
2425
import="org.apache.hadoop.fs.Path"
2526
import="org.apache.hadoop.hbase.io.hfile.HFilePrettyPrinter"
2627
import="org.apache.hadoop.hbase.regionserver.HRegionServer"
28+
import="org.apache.hadoop.hbase.regionserver.StoreFileInfo"
2729
%>
2830
<%
2931
String storeFile = request.getParameter("name");
3032
HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
3133
Configuration conf = rs.getConfiguration();
34+
FileSystem fs = FileSystem.get(conf);
3235
pageContext.setAttribute("pageTitle", "HBase RegionServer: " + rs.getServerName());
3336
%>
3437
<jsp:include page="header.jsp">
@@ -51,7 +54,8 @@
5154
printer.setConf(conf);
5255
String[] options = {"-s"};
5356
printer.parseOptions(options);
54-
printer.processFile(new Path(storeFile), true);
57+
StoreFileInfo sfi = new StoreFileInfo(conf, fs, new Path(storeFile), true);
58+
printer.processFile(sfi.getFileStatus().getPath(), true);
5559
String text = byteStream.toString();%>
5660
<%=
5761
text

0 commit comments

Comments
 (0)