HBASE-9314. Dropping a table always prints a TableInfoMissingException in the master log

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1520425 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2013-09-05 21:05:47 +00:00
parent 2da88f9ce9
commit 787a6f8053
1 changed files with 13 additions and 6 deletions

View File

@ -176,11 +176,7 @@ public class FSTableDescriptors implements TableDescriptors {
+ tablename, ioe);
}
if (tdmt == null) {
LOG.warn("The following folder is in HBase's root directory and " +
"doesn't contain a table descriptor, " +
"do consider deleting it: " + tablename);
} else {
if (tdmt != null) {
this.cache.put(tablename, tdmt);
}
return tdmt == null ? null : tdmt.getTableDescriptor();
@ -487,6 +483,11 @@ public class FSTableDescriptors implements TableDescriptors {
return readTableDescriptor(fs, status, false);
}
/**
* @param tableName table name
* @return TableDescriptorAndModtime or null if no table descriptor was found
* @throws IOException
*/
private TableDescriptorAndModtime getTableDescriptorAndModtime(TableName tableName)
throws IOException {
// ignore both -ROOT- and .META. tables
@ -496,11 +497,17 @@ public class FSTableDescriptors implements TableDescriptors {
return getTableDescriptorAndModtime(getTableDir(tableName));
}
/**
* @param tableDir path to table directory
* @return TableDescriptorAndModtime or null if no table descriptor was found
* at the specified path
* @throws IOException
*/
private TableDescriptorAndModtime getTableDescriptorAndModtime(Path tableDir)
throws IOException {
FileStatus status = getTableInfoPath(tableDir);
if (status == null) {
throw new TableInfoMissingException("No table descriptor file under " + tableDir);
return null;
}
HTableDescriptor htd = readTableDescriptor(fs, status, !fsreadonly);
return new TableDescriptorAndModtime(status.getModificationTime(), htd);