HBASE-9509 Fix HFile V1 Detector to handle AccessControlException for non-existant files

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1522051 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2013-09-11 21:19:07 +00:00
parent 7fb94c126a
commit a00e664801
1 changed files with 2 additions and 0 deletions

View File

@ -340,11 +340,13 @@ public class HFileV1Detector extends Configured implements Tool {
private static boolean isTableDir(final FileSystem fs, final Path path) throws IOException { private static boolean isTableDir(final FileSystem fs, final Path path) throws IOException {
// check for old format, of having /table/.tableinfo; hbase:meta doesn't has .tableinfo, // check for old format, of having /table/.tableinfo; hbase:meta doesn't has .tableinfo,
// include it. // include it.
if (fs.isFile(path)) return false;
return (FSTableDescriptors.getTableInfoPath(fs, path) != null || FSTableDescriptors return (FSTableDescriptors.getTableInfoPath(fs, path) != null || FSTableDescriptors
.getCurrentTableInfoStatus(fs, path, false) != null) || path.toString().endsWith(".META."); .getCurrentTableInfoStatus(fs, path, false) != null) || path.toString().endsWith(".META.");
} }
private static boolean isRegionDir(final FileSystem fs, final Path path) throws IOException { private static boolean isRegionDir(final FileSystem fs, final Path path) throws IOException {
if (fs.isFile(path)) return false;
Path regionInfo = new Path(path, HRegionFileSystem.REGION_INFO_FILE); Path regionInfo = new Path(path, HRegionFileSystem.REGION_INFO_FILE);
return fs.exists(regionInfo); return fs.exists(regionInfo);