From 787a6f8053059e0d89a51ef1f06bd84340fa307c Mon Sep 17 00:00:00 2001 From: Andrew Kyle Purtell Date: Thu, 5 Sep 2013 21:05:47 +0000 Subject: [PATCH] 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 --- .../hadoop/hbase/util/FSTableDescriptors.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java index 4adcc1083e3..f6fc2ccdbde 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java @@ -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);