.setParent(INSTANCE_NAME) .build();
ListTablesRequest request = ListTablesRequest.newBuilder() .setParent(NameUtil.formatInstanceName(projectId, instanceId)) .build();
/** {@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(); }
ListTablesRequest request = ListTablesRequest.newBuilder() .setParent(NameUtil.formatInstanceName(projectId, instanceId)) .build();
/** * Lists all tables served from a specified instance. * * <p>Sample code: * * <pre><code> * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * for (Table element : baseBigtableTableAdminClient.listTables(parent.toString()).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent The unique name of the instance for which tables should be listed. Values are of * the form `projects/<project>/instances/<instance>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListTablesPagedResponse listTables(String parent) { ListTablesRequest request = ListTablesRequest.newBuilder().setParent(parent).build(); return listTables(request); }
/** * Lists all tables served from a specified instance. * * <p>Sample code: * * <pre><code> * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * for (Table element : baseBigtableTableAdminClient.listTables(parent).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent The unique name of the instance for which tables should be listed. Values are of * the form `projects/<project>/instances/<instance>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListTablesPagedResponse listTables(InstanceName parent) { ListTablesRequest request = ListTablesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); return listTables(request); }
/** {@inheritDoc} */ @Override public ListenableFuture<List<String>> listTablesAsync() { ListTablesRequest request = ListTablesRequest.newBuilder() .setParent(instanceName.toString()) .build(); ListenableFuture<ListTablesResponse> response = adminClient.listTablesAsync(request); return Futures.transform(response, new Function<ListTablesResponse, List<String>>() { @Override public List<String> apply(ListTablesResponse input) { ImmutableList.Builder<String> tableIdsBuilder = ImmutableList.builder(); for(com.google.bigtable.admin.v2.Table tableProto : input.getTablesList()){ tableIdsBuilder.add(instanceName.toTableId(tableProto.getName())); } return tableIdsBuilder.build(); } }, MoreExecutors.directExecutor()); }
private CompletableFuture<List<Table>> requestTableList() { ListTablesRequest request = ListTablesRequest.newBuilder().setParent(bigtableInstanceName.toString()).build(); return bigtableTableAdminClient.listTablesAsync(request) .thenApply(r -> r.getTablesList()); }
/** * 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); } }
private CompletableFuture<List<Table>> requestTableList() { ListTablesRequest request = ListTablesRequest.newBuilder().setParent(bigtableInstanceName.toString()).build(); return bigtableTableAdminClient.listTablesAsync(request) .thenApply(r -> r.getTablesList()); }
/** * Lists all tables served from a specified instance. * * <p>Sample code: * * <pre><code> * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * for (Table element : baseBigtableTableAdminClient.listTables(parent.toString()).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent The unique name of the instance for which tables should be listed. Values are of * the form `projects/<project>/instances/<instance>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListTablesPagedResponse listTables(String parent) { ListTablesRequest request = ListTablesRequest.newBuilder().setParent(parent).build(); return listTables(request); }
/** * Lists all tables served from a specified instance. * * <p>Sample code: * * <pre><code> * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * for (Table element : baseBigtableTableAdminClient.listTables(parent).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent The unique name of the instance for which tables should be listed. Values are of * the form `projects/<project>/instances/<instance>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListTablesPagedResponse listTables(InstanceName parent) { ListTablesRequest request = ListTablesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); return listTables(request); }