From 3c81d656e02aca80fb9f6fe0636b953202c79054 Mon Sep 17 00:00:00 2001 From: Jerry He Date: Fri, 17 Apr 2015 11:33:24 -0700 Subject: [PATCH] HBASE-13456 Improve HFilePrettyPrinter first hbase:meta region processing (Samir Ahmic) --- .../java/org/apache/hadoop/hbase/io/hfile/HFile.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java index 7e658e78fff..f014f1741b2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java @@ -811,7 +811,7 @@ public class HFile { } /** - * Returns all files belonging to the given region directory. Could return an + * Returns all HFiles belonging to the given region directory. Could return an * empty list. * * @param fs The file system reference. @@ -821,18 +821,20 @@ public class HFile { */ static List getStoreFiles(FileSystem fs, Path regionDir) throws IOException { - List res = new ArrayList(); + List regionHFiles = new ArrayList(); PathFilter dirFilter = new FSUtils.DirFilter(fs); FileStatus[] familyDirs = fs.listStatus(regionDir, dirFilter); for(FileStatus dir : familyDirs) { FileStatus[] files = fs.listStatus(dir.getPath()); for (FileStatus file : files) { - if (!file.isDirectory()) { - res.add(file.getPath()); + if (!file.isDirectory() && + (!file.getPath().toString().contains(HConstants.HREGION_OLDLOGDIR_NAME)) && + (!file.getPath().toString().contains(HConstants.RECOVERED_EDITS_DIR))) { + regionHFiles.add(file.getPath()); } } } - return res; + return regionHFiles; } /**