/** * Request a list of Tables for the cluster. The {@link Table}s in the response will only * contain fully qualified Bigtable table names, and not column family information. */ private ListTablesResponse requestTableList() throws IOException { try { ListTablesRequest.Builder builder = ListTablesRequest.newBuilder(); builder.setParent(bigtableInstanceName.toString()); return bigtableTableAdminClient.listTables(builder.build()); } catch (Throwable throwable) { throw new IOException("Failed to listTables", throwable); } }
/** {@inheritDoc} */ @Override public List<String> listTables() { ListTablesRequest requestProto = ListTablesRequest.newBuilder() .setParent(instanceName.toString()) .build(); ListTablesResponse response = adminClient.listTables(requestProto); ImmutableList.Builder<String> tableIdsBuilder = ImmutableList.builder(); for(com.google.bigtable.admin.v2.Table tableProto : response.getTablesList()){ tableIdsBuilder.add(instanceName.toTableId(tableProto.getName())); } return tableIdsBuilder.build(); }