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:
parent
2da88f9ce9
commit
787a6f8053
|
@ -176,11 +176,7 @@ public class FSTableDescriptors implements TableDescriptors {
|
||||||
+ tablename, ioe);
|
+ tablename, ioe);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tdmt == null) {
|
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 {
|
|
||||||
this.cache.put(tablename, tdmt);
|
this.cache.put(tablename, tdmt);
|
||||||
}
|
}
|
||||||
return tdmt == null ? null : tdmt.getTableDescriptor();
|
return tdmt == null ? null : tdmt.getTableDescriptor();
|
||||||
|
@ -487,6 +483,11 @@ public class FSTableDescriptors implements TableDescriptors {
|
||||||
return readTableDescriptor(fs, status, false);
|
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)
|
private TableDescriptorAndModtime getTableDescriptorAndModtime(TableName tableName)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
// ignore both -ROOT- and .META. tables
|
// ignore both -ROOT- and .META. tables
|
||||||
|
@ -496,11 +497,17 @@ public class FSTableDescriptors implements TableDescriptors {
|
||||||
return getTableDescriptorAndModtime(getTableDir(tableName));
|
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)
|
private TableDescriptorAndModtime getTableDescriptorAndModtime(Path tableDir)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
FileStatus status = getTableInfoPath(tableDir);
|
FileStatus status = getTableInfoPath(tableDir);
|
||||||
if (status == null) {
|
if (status == null) {
|
||||||
throw new TableInfoMissingException("No table descriptor file under " + tableDir);
|
return null;
|
||||||
}
|
}
|
||||||
HTableDescriptor htd = readTableDescriptor(fs, status, !fsreadonly);
|
HTableDescriptor htd = readTableDescriptor(fs, status, !fsreadonly);
|
||||||
return new TableDescriptorAndModtime(status.getModificationTime(), htd);
|
return new TableDescriptorAndModtime(status.getModificationTime(), htd);
|
||||||
|
|
Loading…
Reference in New Issue