Class TablesServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
- The API has a collection of [Table][google.area120.tables.v1alpha1.Table] resources, named `tables/*`
- Each Table has a collection of [Row][google.area120.tables.v1alpha1.Row] resources, named `tables/*/rows/*`
- The API has a collection of [Workspace][google.area120.tables.v1alpha1.Workspace] resources, named `workspaces/*`.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
TableName name = TableName.of("[TABLE]");
Table response = tablesServiceClient.getTable(name);
}
Note: close() needs to be called on the TablesServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
GetTable |
Gets a table. Returns NOT_FOUND if the table does not exist. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListTables |
Lists tables for the user. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetWorkspace |
Gets a workspace. Returns NOT_FOUND if the workspace does not exist. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListWorkspaces |
Lists workspaces for the user. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRow |
Gets a row. Returns NOT_FOUND if the row does not exist in the table. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListRows |
Lists rows in a table. Returns NOT_FOUND if the table does not exist. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateRow |
Creates a row. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchCreateRows |
Creates multiple rows. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateRow |
Updates a row. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchUpdateRows |
Updates multiple rows. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteRow |
Deletes a row. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchDeleteRows |
Deletes multiple rows. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of TablesServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
TablesServiceSettings tablesServiceSettings =
TablesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
TablesServiceSettings tablesServiceSettings =
TablesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
TablesServiceSettings tablesServiceSettings =
TablesServiceSettings.newHttpJsonBuilder().build();
TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedTablesServiceClient(TablesServiceSettings settings) Constructs an instance of TablesServiceClient, using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final BatchCreateRowsResponsebatchCreateRows(BatchCreateRowsRequest request) Creates multiple rows.Creates multiple rows.final voidbatchDeleteRows(BatchDeleteRowsRequest request) Deletes multiple rows.final UnaryCallable<BatchDeleteRowsRequest,com.google.protobuf.Empty> Deletes multiple rows.final BatchUpdateRowsResponsebatchUpdateRows(BatchUpdateRowsRequest request) Updates multiple rows.Updates multiple rows.final voidclose()static final TablesServiceClientcreate()Constructs an instance of TablesServiceClient with default settings.static final TablesServiceClientcreate(TablesServiceStub stub) Constructs an instance of TablesServiceClient, using the given stub for making calls.static final TablesServiceClientcreate(TablesServiceSettings settings) Constructs an instance of TablesServiceClient, using the given settings.final RowcreateRow(CreateRowRequest request) Creates a row.final RowCreates a row.final UnaryCallable<CreateRowRequest,Row> Creates a row.final voiddeleteRow(DeleteRowRequest request) Deletes a row.final voidDeletes a row.final voidDeletes a row.final UnaryCallable<DeleteRowRequest,com.google.protobuf.Empty> Deletes a row.final RowgetRow(GetRowRequest request) Gets a row.final RowGets a row.final RowGets a row.final UnaryCallable<GetRowRequest,Row> Gets a row.final TablesServiceSettingsgetStub()final TablegetTable(GetTableRequest request) Gets a table.final TableGets a table.final TableGets a table.final UnaryCallable<GetTableRequest,Table> Gets a table.final WorkspacegetWorkspace(GetWorkspaceRequest request) Gets a workspace.final WorkspacegetWorkspace(WorkspaceName name) Gets a workspace.final WorkspacegetWorkspace(String name) Gets a workspace.Gets a workspace.booleanbooleanlistRows(ListRowsRequest request) Lists rows in a table.Lists rows in a table.Lists rows in a table.Lists rows in a table.listTables(ListTablesRequest request) Lists tables for the user.Lists tables for the user.Lists tables for the user.listWorkspaces(ListWorkspacesRequest request) Lists workspaces for the user.Lists workspaces for the user.Lists workspaces for the user.voidshutdown()voidfinal RowUpdates a row.final RowupdateRow(UpdateRowRequest request) Updates a row.final UnaryCallable<UpdateRowRequest,Row> Updates a row.
-
Constructor Details
-
TablesServiceClient
Constructs an instance of TablesServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
TablesServiceClient
-
-
Method Details
-
create
Constructs an instance of TablesServiceClient with default settings.- Throws:
IOException
-
create
Constructs an instance of TablesServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of TablesServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(TablesServiceSettings). -
getSettings
-
getStub
-
getTable
Gets a table. Returns NOT_FOUND if the table does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { TableName name = TableName.of("[TABLE]"); Table response = tablesServiceClient.getTable(name); }- Parameters:
name- Required. The name of the table to retrieve. Format: tables/{table}- Throws:
ApiException- if the remote call fails
-
getTable
Gets a table. Returns NOT_FOUND if the table does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { String name = TableName.of("[TABLE]").toString(); Table response = tablesServiceClient.getTable(name); }- Parameters:
name- Required. The name of the table to retrieve. Format: tables/{table}- Throws:
ApiException- if the remote call fails
-
getTable
Gets a table. Returns NOT_FOUND if the table does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { GetTableRequest request = GetTableRequest.newBuilder().setName(TableName.of("[TABLE]").toString()).build(); Table response = tablesServiceClient.getTable(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getTableCallable
Gets a table. Returns NOT_FOUND if the table does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { GetTableRequest request = GetTableRequest.newBuilder().setName(TableName.of("[TABLE]").toString()).build(); ApiFuture<Table> future = tablesServiceClient.getTableCallable().futureCall(request); // Do something. Table response = future.get(); } -
listTables
Lists tables for the user.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { ListTablesRequest request = ListTablesRequest.newBuilder() .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Table element : tablesServiceClient.listTables(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listTablesPagedCallable
public final UnaryCallable<ListTablesRequest,TablesServiceClient.ListTablesPagedResponse> listTablesPagedCallable()Lists tables for the user.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { ListTablesRequest request = ListTablesRequest.newBuilder() .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Table> future = tablesServiceClient.listTablesPagedCallable().futureCall(request); // Do something. for (Table element : future.get().iterateAll()) { // doThingsWith(element); } } -
listTablesCallable
Lists tables for the user.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { ListTablesRequest request = ListTablesRequest.newBuilder() .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListTablesResponse response = tablesServiceClient.listTablesCallable().call(request); for (Table element : response.getTablesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getWorkspace
Gets a workspace. Returns NOT_FOUND if the workspace does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { WorkspaceName name = WorkspaceName.of("[WORKSPACE]"); Workspace response = tablesServiceClient.getWorkspace(name); }- Parameters:
name- Required. The name of the workspace to retrieve. Format: workspaces/{workspace}- Throws:
ApiException- if the remote call fails
-
getWorkspace
Gets a workspace. Returns NOT_FOUND if the workspace does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { String name = WorkspaceName.of("[WORKSPACE]").toString(); Workspace response = tablesServiceClient.getWorkspace(name); }- Parameters:
name- Required. The name of the workspace to retrieve. Format: workspaces/{workspace}- Throws:
ApiException- if the remote call fails
-
getWorkspace
Gets a workspace. Returns NOT_FOUND if the workspace does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { GetWorkspaceRequest request = GetWorkspaceRequest.newBuilder() .setName(WorkspaceName.of("[WORKSPACE]").toString()) .build(); Workspace response = tablesServiceClient.getWorkspace(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getWorkspaceCallable
Gets a workspace. Returns NOT_FOUND if the workspace does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { GetWorkspaceRequest request = GetWorkspaceRequest.newBuilder() .setName(WorkspaceName.of("[WORKSPACE]").toString()) .build(); ApiFuture<Workspace> future = tablesServiceClient.getWorkspaceCallable().futureCall(request); // Do something. Workspace response = future.get(); } -
listWorkspaces
public final TablesServiceClient.ListWorkspacesPagedResponse listWorkspaces(ListWorkspacesRequest request) Lists workspaces for the user.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { ListWorkspacesRequest request = ListWorkspacesRequest.newBuilder() .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Workspace element : tablesServiceClient.listWorkspaces(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listWorkspacesPagedCallable
public final UnaryCallable<ListWorkspacesRequest,TablesServiceClient.ListWorkspacesPagedResponse> listWorkspacesPagedCallable()Lists workspaces for the user.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { ListWorkspacesRequest request = ListWorkspacesRequest.newBuilder() .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Workspace> future = tablesServiceClient.listWorkspacesPagedCallable().futureCall(request); // Do something. for (Workspace element : future.get().iterateAll()) { // doThingsWith(element); } } -
listWorkspacesCallable
Lists workspaces for the user.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { ListWorkspacesRequest request = ListWorkspacesRequest.newBuilder() .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListWorkspacesResponse response = tablesServiceClient.listWorkspacesCallable().call(request); for (Workspace element : response.getWorkspacesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getRow
Gets a row. Returns NOT_FOUND if the row does not exist in the table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { RowName name = RowName.of("[TABLE]", "[ROW]"); Row response = tablesServiceClient.getRow(name); }- Parameters:
name- Required. The name of the row to retrieve. Format: tables/{table}/rows/{row}- Throws:
ApiException- if the remote call fails
-
getRow
Gets a row. Returns NOT_FOUND if the row does not exist in the table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { String name = RowName.of("[TABLE]", "[ROW]").toString(); Row response = tablesServiceClient.getRow(name); }- Parameters:
name- Required. The name of the row to retrieve. Format: tables/{table}/rows/{row}- Throws:
ApiException- if the remote call fails
-
getRow
Gets a row. Returns NOT_FOUND if the row does not exist in the table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { GetRowRequest request = GetRowRequest.newBuilder() .setName(RowName.of("[TABLE]", "[ROW]").toString()) .setView(View.forNumber(0)) .build(); Row response = tablesServiceClient.getRow(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getRowCallable
Gets a row. Returns NOT_FOUND if the row does not exist in the table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { GetRowRequest request = GetRowRequest.newBuilder() .setName(RowName.of("[TABLE]", "[ROW]").toString()) .setView(View.forNumber(0)) .build(); ApiFuture<Row> future = tablesServiceClient.getRowCallable().futureCall(request); // Do something. Row response = future.get(); } -
listRows
Lists rows in a table. Returns NOT_FOUND if the table does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { String parent = "parent-995424086"; for (Row element : tablesServiceClient.listRows(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent table. Format: tables/{table}- Throws:
ApiException- if the remote call fails
-
listRows
Lists rows in a table. Returns NOT_FOUND if the table does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { ListRowsRequest request = ListRowsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setView(View.forNumber(0)) .setFilter("filter-1274492040") .build(); for (Row element : tablesServiceClient.listRows(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listRowsPagedCallable
public final UnaryCallable<ListRowsRequest,TablesServiceClient.ListRowsPagedResponse> listRowsPagedCallable()Lists rows in a table. Returns NOT_FOUND if the table does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { ListRowsRequest request = ListRowsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setView(View.forNumber(0)) .setFilter("filter-1274492040") .build(); ApiFuture<Row> future = tablesServiceClient.listRowsPagedCallable().futureCall(request); // Do something. for (Row element : future.get().iterateAll()) { // doThingsWith(element); } } -
listRowsCallable
Lists rows in a table. Returns NOT_FOUND if the table does not exist.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { ListRowsRequest request = ListRowsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setView(View.forNumber(0)) .setFilter("filter-1274492040") .build(); while (true) { ListRowsResponse response = tablesServiceClient.listRowsCallable().call(request); for (Row element : response.getRowsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createRow
Creates a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { String parent = "parent-995424086"; Row row = Row.newBuilder().build(); Row response = tablesServiceClient.createRow(parent, row); }- Parameters:
parent- Required. The parent table where this row will be created. Format: tables/{table}row- Required. The row to create.- Throws:
ApiException- if the remote call fails
-
createRow
Creates a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { CreateRowRequest request = CreateRowRequest.newBuilder() .setParent("parent-995424086") .setRow(Row.newBuilder().build()) .setView(View.forNumber(0)) .build(); Row response = tablesServiceClient.createRow(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createRowCallable
Creates a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { CreateRowRequest request = CreateRowRequest.newBuilder() .setParent("parent-995424086") .setRow(Row.newBuilder().build()) .setView(View.forNumber(0)) .build(); ApiFuture<Row> future = tablesServiceClient.createRowCallable().futureCall(request); // Do something. Row response = future.get(); } -
batchCreateRows
Creates multiple rows.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { BatchCreateRowsRequest request = BatchCreateRowsRequest.newBuilder() .setParent("parent-995424086") .addAllRequests(new ArrayList<CreateRowRequest>()) .build(); BatchCreateRowsResponse response = tablesServiceClient.batchCreateRows(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchCreateRowsCallable
public final UnaryCallable<BatchCreateRowsRequest,BatchCreateRowsResponse> batchCreateRowsCallable()Creates multiple rows.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { BatchCreateRowsRequest request = BatchCreateRowsRequest.newBuilder() .setParent("parent-995424086") .addAllRequests(new ArrayList<CreateRowRequest>()) .build(); ApiFuture<BatchCreateRowsResponse> future = tablesServiceClient.batchCreateRowsCallable().futureCall(request); // Do something. BatchCreateRowsResponse response = future.get(); } -
updateRow
Updates a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { Row row = Row.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Row response = tablesServiceClient.updateRow(row, updateMask); }- Parameters:
row- Required. The row to update.updateMask- The list of fields to update.- Throws:
ApiException- if the remote call fails
-
updateRow
Updates a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { UpdateRowRequest request = UpdateRowRequest.newBuilder() .setRow(Row.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setView(View.forNumber(0)) .build(); Row response = tablesServiceClient.updateRow(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateRowCallable
Updates a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { UpdateRowRequest request = UpdateRowRequest.newBuilder() .setRow(Row.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setView(View.forNumber(0)) .build(); ApiFuture<Row> future = tablesServiceClient.updateRowCallable().futureCall(request); // Do something. Row response = future.get(); } -
batchUpdateRows
Updates multiple rows.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { BatchUpdateRowsRequest request = BatchUpdateRowsRequest.newBuilder() .setParent("parent-995424086") .addAllRequests(new ArrayList<UpdateRowRequest>()) .build(); BatchUpdateRowsResponse response = tablesServiceClient.batchUpdateRows(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchUpdateRowsCallable
public final UnaryCallable<BatchUpdateRowsRequest,BatchUpdateRowsResponse> batchUpdateRowsCallable()Updates multiple rows.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { BatchUpdateRowsRequest request = BatchUpdateRowsRequest.newBuilder() .setParent("parent-995424086") .addAllRequests(new ArrayList<UpdateRowRequest>()) .build(); ApiFuture<BatchUpdateRowsResponse> future = tablesServiceClient.batchUpdateRowsCallable().futureCall(request); // Do something. BatchUpdateRowsResponse response = future.get(); } -
deleteRow
Deletes a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { RowName name = RowName.of("[TABLE]", "[ROW]"); tablesServiceClient.deleteRow(name); }- Parameters:
name- Required. The name of the row to delete. Format: tables/{table}/rows/{row}- Throws:
ApiException- if the remote call fails
-
deleteRow
Deletes a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { String name = RowName.of("[TABLE]", "[ROW]").toString(); tablesServiceClient.deleteRow(name); }- Parameters:
name- Required. The name of the row to delete. Format: tables/{table}/rows/{row}- Throws:
ApiException- if the remote call fails
-
deleteRow
Deletes a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { DeleteRowRequest request = DeleteRowRequest.newBuilder().setName(RowName.of("[TABLE]", "[ROW]").toString()).build(); tablesServiceClient.deleteRow(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteRowCallable
Deletes a row.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { DeleteRowRequest request = DeleteRowRequest.newBuilder().setName(RowName.of("[TABLE]", "[ROW]").toString()).build(); ApiFuture<Empty> future = tablesServiceClient.deleteRowCallable().futureCall(request); // Do something. future.get(); } -
batchDeleteRows
Deletes multiple rows.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { BatchDeleteRowsRequest request = BatchDeleteRowsRequest.newBuilder() .setParent(TableName.of("[TABLE]").toString()) .addAllNames(new ArrayList<String>()) .build(); tablesServiceClient.batchDeleteRows(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchDeleteRowsCallable
public final UnaryCallable<BatchDeleteRowsRequest,com.google.protobuf.Empty> batchDeleteRowsCallable()Deletes multiple rows.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { BatchDeleteRowsRequest request = BatchDeleteRowsRequest.newBuilder() .setParent(TableName.of("[TABLE]").toString()) .addAllNames(new ArrayList<String>()) .build(); ApiFuture<Empty> future = tablesServiceClient.batchDeleteRowsCallable().futureCall(request); // Do something. future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-