/** * List all the userspace tables. In other words, scan the META table. * * 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 META table's region info. * * @return - returns an array of HTableDescriptors * @throws IOException if a remote or network exception occurs */ public HTableDescriptor[] listTables() throws IOException { return this.connection.listTables(); }
private void deleteAllTables(HConnection connection, HBaseAdmin hBaseAdmin) { try { HTableDescriptor[] listTables = connection.listTables(); for (HTableDescriptor hTableDescriptor : listTables) { byte[] tableName = hTableDescriptor.getName(); hBaseAdmin.disableTable(tableName); hBaseAdmin.deleteTable(tableName); } } catch (IOException e) { throw new IllegalArgumentException(e); } }
private void deleteAllTables(HConnection connection, HBaseAdmin hBaseAdmin) { try { HTableDescriptor[] listTables = connection.listTables(); for (HTableDescriptor hTableDescriptor : listTables) { byte[] tableName = hTableDescriptor.getName(); hBaseAdmin.disableTable(tableName); hBaseAdmin.deleteTable(tableName); } } catch (IOException e) { throw new IllegalArgumentException(e); } }
hbaseConnection.listTables(); LOG.info(" HBase availability successfully verified."); } catch (IOException e) {