From e558fc9cd8a13d50b5277e95033ab1f5a831a43d Mon Sep 17 00:00:00 2001 From: Toshihiro Suzuki Date: Tue, 3 Dec 2019 15:15:40 +0900 Subject: [PATCH] HBASE-22096 /storeFile.jsp shows CorruptHFileException when the storeFile is a reference file (#888) Signed-off-by: Lijin Bin --- .../main/resources/hbase-webapps/regionserver/storeFile.jsp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/storeFile.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/storeFile.jsp index c1de41c3672..b538cb7b6b4 100644 --- a/hbase-server/src/main/resources/hbase-webapps/regionserver/storeFile.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/storeFile.jsp @@ -21,14 +21,17 @@ import="java.io.ByteArrayOutputStream" import="java.io.PrintStream" import="org.apache.hadoop.conf.Configuration" + import="org.apache.hadoop.fs.FileSystem" import="org.apache.hadoop.fs.Path" import="org.apache.hadoop.hbase.io.hfile.HFilePrettyPrinter" import="org.apache.hadoop.hbase.regionserver.HRegionServer" + import="org.apache.hadoop.hbase.regionserver.StoreFileInfo" %> <% String storeFile = request.getParameter("name"); HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER); Configuration conf = rs.getConfiguration(); + FileSystem fs = FileSystem.get(conf); pageContext.setAttribute("pageTitle", "HBase RegionServer: " + rs.getServerName()); %> @@ -51,7 +54,8 @@ printer.setConf(conf); String[] options = {"-s"}; printer.parseOptions(options); - printer.processFile(new Path(storeFile), true); + StoreFileInfo sfi = new StoreFileInfo(conf, fs, new Path(storeFile), true); + printer.processFile(sfi.getFileStatus().getPath(), true); String text = byteStream.toString();%> <%= text