HiveCatalogStore extends CatalogConstants implements CatalogStore { @Override public final List<String> getAllTableNames(String databaseName) throws CatalogException { HiveCatalogStoreClientPool.HiveCatalogStoreClient client = null; try { client = clientPool.getClient(); return client.getHiveClient().getAllTables(databaseName); } catch (TException e) { throw new CatalogException(e); } finally { if(client != null) client.release(); } } HiveCatalogStore(final Configuration conf); @Override boolean existTable(final String databaseName, final String tableName); @Override final CatalogProtos.TableDescProto getTable(String databaseName, final String tableName); @Override final List<String> getAllTableNames(String databaseName); @Override void createTablespace(String spaceName, String spaceUri); @Override boolean existTablespace(String spaceName); @Override void dropTablespace(String spaceName); @Override Collection<String> getAllTablespaceNames(); @Override TablespaceProto getTablespace(String spaceName); @Override void updateTableStats(CatalogProtos.UpdateTableStatsProto statsProto); @Override void alterTablespace(CatalogProtos.AlterTablespaceProto alterProto); @Override void createDatabase(String databaseName, String tablespaceName); @Override boolean existDatabase(String databaseName); @Override void dropDatabase(String databaseName); @Override Collection<String> getAllDatabaseNames(); @Override final void createTable(final CatalogProtos.TableDescProto tableDescProto); @Override final void dropTable(String databaseName, final String tableName); @Override void alterTable(final CatalogProtos.AlterTableDescProto alterTableDescProto); @Override void addPartitionMethod(CatalogProtos.PartitionMethodProto partitionMethodProto); @Override CatalogProtos.PartitionMethodProto getPartitionMethod(String databaseName, String tableName); @Override boolean existPartitionMethod(String databaseName, String tableName); @Override void dropPartitionMethod(String databaseName, String tableName); @Override List<CatalogProtos.PartitionDescProto> getPartitions(String databaseName,
                                                         String tableName); @Override CatalogProtos.PartitionDescProto getPartition(String databaseName, String tableName,
                                                       String partitionName); @Override final void addFunction(final FunctionDesc func); @Override final void deleteFunction(final FunctionDesc func); @Override final void existFunction(final FunctionDesc func); @Override final List<String> getAllFunctionNames(); @Override void dropIndex(String databaseName, String indexName); @Override boolean existIndexByName(String databaseName, String indexName); @Override CatalogProtos.IndexDescProto[] getIndexes(String databaseName, String tableName); @Override void createIndex(CatalogProtos.IndexDescProto proto); @Override CatalogProtos.IndexDescProto getIndexByName(String databaseName, String indexName); @Override CatalogProtos.IndexDescProto getIndexByColumn(String databaseName, String tableName, String columnName); @Override boolean existIndexByColumn(String databaseName, String tableName, String columnName); @Override final void close(); @Override List<ColumnProto> getAllColumns(); @Override List<DatabaseProto> getAllDatabases(); @Override List<IndexProto> getAllIndexes(); @Override List<TablePartitionProto> getAllPartitions(); @Override List<TableOptionProto> getAllTableOptions(); @Override List<TableStatsProto> getAllTableStats(); @Override List<TableDescriptorProto> getAllTables(); @Override List<TablespaceProto> getTablespaces();  }
@Test public void testGetAllTableNames() throws Exception{ TableMeta meta = new TableMeta("CSV", new KeyValueSet()); org.apache.tajo.catalog.Schema schema = new org.apache.tajo.catalog.Schema(); schema.addColumn("n_name", TajoDataTypes.Type.TEXT); schema.addColumn("n_regionkey", TajoDataTypes.Type.INT4); schema.addColumn("n_comment", TajoDataTypes.Type.TEXT); String[] tableNames = new String[]{"table1", "table2", "table3"}; for(String tableName : tableNames){ TableDesc table = new TableDesc(CatalogUtil.buildFQName("default", tableName), schema, meta, new Path(warehousePath, new Path(DB_NAME, tableName)).toUri()); store.createTable(table.getProto()); } List<String> tables = store.getAllTableNames("default"); assertEquals(tableNames.length, tables.size()); for(String tableName : tableNames){ assertTrue(tables.contains(tableName)); } for(String tableName : tableNames){ store.dropTable("default", tableName); } }