HBASE-13456 Improve HFilePrettyPrinter first hbase:meta region processing (Samir Ahmic)

This commit is contained in:
Jerry He 2015-04-17 11:33:24 -07:00
parent cf45c8d30a
commit 3c81d656e0
1 changed files with 7 additions and 5 deletions

View File

@ -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. * empty list.
* *
* @param fs The file system reference. * @param fs The file system reference.
@ -821,18 +821,20 @@ public class HFile {
*/ */
static List<Path> getStoreFiles(FileSystem fs, Path regionDir) static List<Path> getStoreFiles(FileSystem fs, Path regionDir)
throws IOException { throws IOException {
List<Path> res = new ArrayList<Path>(); List<Path> regionHFiles = new ArrayList<Path>();
PathFilter dirFilter = new FSUtils.DirFilter(fs); PathFilter dirFilter = new FSUtils.DirFilter(fs);
FileStatus[] familyDirs = fs.listStatus(regionDir, dirFilter); FileStatus[] familyDirs = fs.listStatus(regionDir, dirFilter);
for(FileStatus dir : familyDirs) { for(FileStatus dir : familyDirs) {
FileStatus[] files = fs.listStatus(dir.getPath()); FileStatus[] files = fs.listStatus(dir.getPath());
for (FileStatus file : files) { for (FileStatus file : files) {
if (!file.isDirectory()) { if (!file.isDirectory() &&
res.add(file.getPath()); (!file.getPath().toString().contains(HConstants.HREGION_OLDLOGDIR_NAME)) &&
(!file.getPath().toString().contains(HConstants.RECOVERED_EDITS_DIR))) {
regionHFiles.add(file.getPath());
} }
} }
} }
return res; return regionHFiles;
} }
/** /**