Index: hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java =================================================================== --- hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (revision 1570504) +++ hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (working copy) @@ -278,14 +278,18 @@ */ public boolean tableExists(final TableName tableName) throws IOException { - boolean b = false; - CatalogTracker ct = getCatalogTracker(); + GetTableDescriptorsResponse htds; + MasterKeepAliveConnection master = connection.getKeepAliveMasterService(); try { - b = MetaReader.tableExists(ct, tableName); + GetTableDescriptorsRequest req = + RequestConverter.buildGetTableDescriptorsRequest(tableName); + htds = master.getTableDescriptors(null, req); + } catch (ServiceException se) { + throw ProtobufUtil.getRemoteException(se); } finally { - cleanupCatalogTracker(ct); + master.close(); } - return b; + return !htds.getTableSchemaList().isEmpty(); } public boolean tableExists(final byte[] tableName) @@ -299,12 +303,8 @@ } /** - * List all the userspace tables. In other words, scan the hbase:meta table. + * List all the userspace tables. * - * If we wanted this to be really fast, we could implement a special - * catalog table that just contains table names and their descriptors. - * Right now, it only exists as part of the hbase:meta table's region info. - * * @return - returns an array of HTableDescriptors * @throws IOException if a remote or network exception occurs */