diff --git a/CHANGES.txt b/CHANGES.txt index af576375ebb..b2370a558aa 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -50,7 +50,8 @@ Hbase Change Log collected HBASE-407 Keep HRegionLocation information in LRU structure (Bryan Duxbury) - + HBASE-444 hbase is very slow at determining table is not present + (Bryan Duxbury) Branch 0.1 diff --git a/src/java/org/apache/hadoop/hbase/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/HConnectionManager.java index 8fd3aed5dda..cf2be17b7da 100644 --- a/src/java/org/apache/hadoop/hbase/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/HConnectionManager.java @@ -421,17 +421,17 @@ public class HConnectionManager implements HConstants { HRegionInfo regionInfo = (HRegionInfo) Writables.getWritable( results.get(COL_REGIONINFO), new HRegionInfo()); - if (regionInfo.isOffline()) { - throw new IllegalStateException("region offline: " + - regionInfo.getRegionName()); - } - // possible we got a region of a different table... if (!regionInfo.getTableDesc().getName().equals(tableName)) { throw new TableNotFoundException( "Table '" + tableName + "' was not found."); } + if (regionInfo.isOffline()) { + throw new IllegalStateException("region offline: " + + regionInfo.getRegionName()); + } + String serverAddress = Writables.bytesToString(results.get(COL_SERVER)); @@ -457,6 +457,11 @@ public class HConnectionManager implements HConstants { } else { throw e; } + } catch (TableNotFoundException e) { + // if we got this error, probably means the table just plain doesn't + // exist. rethrow the error immediately. this should always be coming + // from the HTable constructor. + throw e; } catch (IOException e) { if (e instanceof RemoteException) { e = RemoteExceptionHandler.decodeRemoteException(