Index: src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java =================================================================== --- src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java (revision 1293001) +++ src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java (working copy) @@ -235,13 +235,13 @@ @Override public HTableDescriptor get(byte[] tablename) - throws TableExistsException, FileNotFoundException, IOException { + throws FileNotFoundException, IOException { return get(Bytes.toString(tablename)); } @Override public HTableDescriptor get(String tablename) - throws TableExistsException, FileNotFoundException, IOException { + throws FileNotFoundException, IOException { return createHTableDescriptor(); } Index: src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java =================================================================== --- src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java (revision 1293001) +++ src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java (working copy) @@ -202,14 +202,15 @@ htds.cachehits >= ((count * 2) + 1)); } - @Test (expected=org.apache.hadoop.hbase.TableExistsException.class) + @Test public void testNoSuchTable() throws IOException { final String name = "testNoSuchTable"; FileSystem fs = FileSystem.get(UTIL.getConfiguration()); // Cleanup old tests if any detrius laying around. Path rootdir = new Path(UTIL.getDataTestDir(), name); TableDescriptors htds = new FSTableDescriptors(fs, rootdir); - htds.get("NoSuchTable"); + assertNull("There shouldn't be any HTD for this table", + htds.get("NoSuchTable")); } @Test Index: src/main/java/org/apache/hadoop/hbase/TableDescriptors.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/TableDescriptors.java (revision 1293001) +++ src/main/java/org/apache/hadoop/hbase/TableDescriptors.java (working copy) @@ -34,7 +34,7 @@ * @throws IOException */ public HTableDescriptor get(final String tablename) - throws TableExistsException, FileNotFoundException, IOException; + throws FileNotFoundException, IOException; /** * @param tablename @@ -44,7 +44,7 @@ * @throws IOException */ public HTableDescriptor get(final byte[] tablename) - throws TableExistsException, FileNotFoundException, IOException; + throws FileNotFoundException, IOException; /** * Get Map of all HTableDescriptors. Populates the descriptor cache as a Index: src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java (revision 1293001) +++ src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java (working copy) @@ -122,7 +122,7 @@ */ @Override public HTableDescriptor get(final byte [] tablename) - throws TableExistsException, FileNotFoundException, IOException { + throws FileNotFoundException, IOException { return get(Bytes.toString(tablename)); } @@ -131,7 +131,7 @@ */ @Override public HTableDescriptor get(final String tablename) - throws TableExistsException, FileNotFoundException, IOException { + throws FileNotFoundException, IOException { invocations++; if (HTableDescriptor.ROOT_TABLEDESC.getNameAsString().equals(tablename)) { cachehits++; @@ -160,10 +160,12 @@ } HTableDescriptor htd = getTableDescriptor(this.fs, this.rootdir, tablename); if (htd == null) { - // More likely is above will throw a FileNotFoundException - throw new TableExistsException("No descriptor for " + tablename); + 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, new TableDescriptorModtime(modtime, htd)); } - this.cache.put(tablename, new TableDescriptorModtime(modtime, htd)); return htd; } Index: src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java (revision 1293001) +++ src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java (working copy) @@ -321,7 +321,7 @@ } private HTableDescriptor getTableDescriptor(byte[] tableName) - throws TableExistsException, FileNotFoundException, IOException { + throws FileNotFoundException, IOException { return this.services.getTableDescriptors().get(Bytes.toString(tableName)); } } Index: src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java (revision 1293001) +++ src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java (working copy) @@ -687,10 +687,7 @@ { tableDescriptor = this.services.getTableDescriptors(). get(Bytes.toString(tableName)); - } - } catch (TableExistsException tee) { - LOG.debug("TableExistsException during getTableDescriptors." + - " Current table name = " + tableName , tee); + } } catch (FileNotFoundException fnfe) { LOG.debug("FileNotFoundException during getTableDescriptors." + " Current table name = " + tableName , fnfe); Index: src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java (revision 1293001) +++ src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java (working copy) @@ -272,7 +272,7 @@ * @throws IOException */ HTableDescriptor getTableDescriptor() - throws TableExistsException, FileNotFoundException, IOException { + throws FileNotFoundException, IOException { final String name = Bytes.toString(tableName); HTableDescriptor htd = this.masterServices.getTableDescriptors().get(name);