Sample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+ * boolean ignoreWarnings = true;
+ * baseBigtableInstanceAdminClient.deleteAppProfile(name, ignoreWarnings);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the app profile to be deleted. Values are of the form
+ * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+ * @param ignoreWarnings Required. If true, ignore safety checks when deleting the app profile.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteAppProfile(AppProfileName name, boolean ignoreWarnings) {
+ DeleteAppProfileRequest request =
+ DeleteAppProfileRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setIgnoreWarnings(ignoreWarnings)
+ .build();
+ deleteAppProfile(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an app profile from an instance.
+ *
+ * Sample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * String name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+ * boolean ignoreWarnings = true;
+ * baseBigtableInstanceAdminClient.deleteAppProfile(name, ignoreWarnings);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the app profile to be deleted. Values are of the form
+ * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
+ * @param ignoreWarnings Required. If true, ignore safety checks when deleting the app profile.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteAppProfile(String name, boolean ignoreWarnings) {
+ DeleteAppProfileRequest request =
+ DeleteAppProfileRequest.newBuilder()
+ .setName(name)
+ .setIgnoreWarnings(ignoreWarnings)
+ .build();
+ deleteAppProfile(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an app profile from an instance.
@@ -3022,77 +3112,1544 @@ public final ListHotTabletsPagedResponse listHotTablets(ListHotTabletsRequest re
return stub.listHotTabletsCallable();
}
- @Override
- public final void close() {
- stub.close();
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a logical view within an instance.
+ *
+ * Sample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * LogicalView logicalView = LogicalView.newBuilder().build();
+ * String logicalViewId = "logicalViewId-1408054263";
+ * LogicalView response =
+ * baseBigtableInstanceAdminClient
+ * .createLogicalViewAsync(parent, logicalView, logicalViewId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent instance where this logical view will be created. Format:
+ * `projects/{project}/instances/{instance}`.
+ * @param logicalView Required. The logical view to create.
+ * @param logicalViewId Required. The ID to use for the logical view, which will become the final
+ * component of the logical view's resource name.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+ * LogicalView logicalView = LogicalView.newBuilder().build();
+ * String logicalViewId = "logicalViewId-1408054263";
+ * LogicalView response =
+ * baseBigtableInstanceAdminClient
+ * .createLogicalViewAsync(parent, logicalView, logicalViewId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent instance where this logical view will be created. Format:
+ * `projects/{project}/instances/{instance}`.
+ * @param logicalView Required. The logical view to create.
+ * @param logicalViewId Required. The ID to use for the logical view, which will become the final
+ * component of the logical view's resource name.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * CreateLogicalViewRequest request =
+ * CreateLogicalViewRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setLogicalViewId("logicalViewId-1408054263")
+ * .setLogicalView(LogicalView.newBuilder().build())
+ * .build();
+ * LogicalView response = baseBigtableInstanceAdminClient.createLogicalViewAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * CreateLogicalViewRequest request =
+ * CreateLogicalViewRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setLogicalViewId("logicalViewId-1408054263")
+ * .setLogicalView(LogicalView.newBuilder().build())
+ * .build();
+ * OperationFuture future =
+ * baseBigtableInstanceAdminClient.createLogicalViewOperationCallable().futureCall(request);
+ * // Do something.
+ * LogicalView response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * CreateLogicalViewRequest request =
+ * CreateLogicalViewRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setLogicalViewId("logicalViewId-1408054263")
+ * .setLogicalView(LogicalView.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * baseBigtableInstanceAdminClient.createLogicalViewCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * LogicalViewName name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]");
+ * LogicalView response = baseBigtableInstanceAdminClient.getLogicalView(name);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the requested logical view. Values are of the form
+ * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogicalView getLogicalView(LogicalViewName name) {
+ GetLogicalViewRequest request =
+ GetLogicalViewRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getLogicalView(request);
}
- public static class ListAppProfilesPagedResponse
- extends AbstractPagedListResponse<
- ListAppProfilesRequest,
- ListAppProfilesResponse,
- AppProfile,
- ListAppProfilesPage,
- ListAppProfilesFixedSizeCollection> {
-
- public static ApiFutureSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * String name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString();
+ * LogicalView response = baseBigtableInstanceAdminClient.getLogicalView(name);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the requested logical view. Values are of the form
+ * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogicalView getLogicalView(String name) {
+ GetLogicalViewRequest request = GetLogicalViewRequest.newBuilder().setName(name).build();
+ return getLogicalView(request);
}
- public static class ListAppProfilesPage
- extends AbstractPage<
- ListAppProfilesRequest, ListAppProfilesResponse, AppProfile, ListAppProfilesPage> {
-
- private ListAppProfilesPage(
- PageContextSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * GetLogicalViewRequest request =
+ * GetLogicalViewRequest.newBuilder()
+ * .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString())
+ * .build();
+ * LogicalView response = baseBigtableInstanceAdminClient.getLogicalView(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogicalView getLogicalView(GetLogicalViewRequest request) {
+ return getLogicalViewCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a logical view.
+ *
+ * Sample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * GetLogicalViewRequest request =
+ * GetLogicalViewRequest.newBuilder()
+ * .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString())
+ * .build();
+ * ApiFuture future =
+ * baseBigtableInstanceAdminClient.getLogicalViewCallable().futureCall(request);
+ * // Do something.
+ * LogicalView response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * for (LogicalView element :
+ * baseBigtableInstanceAdminClient.listLogicalViews(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The unique name of the instance for which the list of logical views is
+ * requested. Values are of the form `projects/{project}/instances/{instance}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLogicalViewsPagedResponse listLogicalViews(InstanceName parent) {
+ ListLogicalViewsRequest request =
+ ListLogicalViewsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listLogicalViews(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about logical views in an instance.
+ *
+ * Sample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+ * for (LogicalView element :
+ * baseBigtableInstanceAdminClient.listLogicalViews(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The unique name of the instance for which the list of logical views is
+ * requested. Values are of the form `projects/{project}/instances/{instance}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLogicalViewsPagedResponse listLogicalViews(String parent) {
+ ListLogicalViewsRequest request =
+ ListLogicalViewsRequest.newBuilder().setParent(parent).build();
+ return listLogicalViews(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about logical views in an instance.
+ *
+ * Sample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * ListLogicalViewsRequest request =
+ * ListLogicalViewsRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (LogicalView element :
+ * baseBigtableInstanceAdminClient.listLogicalViews(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLogicalViewsPagedResponse listLogicalViews(ListLogicalViewsRequest request) {
+ return listLogicalViewsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about logical views in an instance.
+ *
+ * Sample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * ListLogicalViewsRequest request =
+ * ListLogicalViewsRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * baseBigtableInstanceAdminClient.listLogicalViewsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (LogicalView element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * ListLogicalViewsRequest request =
+ * ListLogicalViewsRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLogicalViewsResponse response =
+ * baseBigtableInstanceAdminClient.listLogicalViewsCallable().call(request);
+ * for (LogicalView element : response.getLogicalViewsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * LogicalView logicalView = LogicalView.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * LogicalView response =
+ * baseBigtableInstanceAdminClient.updateLogicalViewAsync(logicalView, updateMask).get();
+ * }
+ * }
+ *
+ * @param logicalView Required. The logical view to update.
+ * The logical view's `name` field is used to identify the view to update. Format:
+ * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+ * @param updateMask Optional. The list of fields to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The materialized view's `name` field is used to identify the view to update. Format:
+ * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+ * @param updateMask Optional. The list of fields to update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * If `column_families` is set in `update_mask`, it will return an UNIMPLEMENTED error.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -973,6 +974,7 @@ public final OperationFuture Sample code:
+ *
+ * See {@link com.google.cloud.bigtable.admin.v2.models.MaterializedView} for more details about
+ * an materialized view.
+ */
+@AutoValue
+public abstract class MaterializedViewId implements TargetId {
+ /** Constructs a new MaterializedViewId object from the specified materializedViewId. */
+ public static MaterializedViewId of(String materializedViewId) {
+ Preconditions.checkNotNull(materializedViewId, "materialized view id can't be null.");
+ return new AutoValue_MaterializedViewId(materializedViewId);
+ }
+
+ abstract String getMaterializedViewId();
+
+ @Override
+ @InternalApi
+ public String toResourceName(String projectId, String instanceId) {
+ return NameUtil.formatMaterializedViewName(projectId, instanceId, getMaterializedViewId());
+ }
+
+ @Override
+ @InternalApi
+ public boolean scopedForAuthorizedView() {
+ return false;
+ }
+
+ @Override
+ @InternalApi
+ public boolean scopedForMaterializedView() {
+ return true;
+ }
+}
diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java
index 1b4cb8d68002..63ec9c131694 100644
--- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java
+++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java
@@ -62,6 +62,7 @@ public static Query create(String tableId) {
* com.google.cloud.bigtable.data.v2.BigtableDataSettings}.
*
* @see AuthorizedViewId
+ * @see MaterializedViewId
* @see TableId
*/
public static Query create(TargetId targetId) {
@@ -317,7 +318,9 @@ public ByteStringRange getBound() {
public ReadRowsRequest toProto(RequestContext requestContext) {
String resourceName =
targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId());
- if (targetId.scopedForAuthorizedView()) {
+ if (targetId.scopedForMaterializedView()) {
+ builder.setMaterializedViewName(resourceName);
+ } else if (targetId.scopedForAuthorizedView()) {
builder.setAuthorizedViewName(resourceName);
} else {
builder.setTableName(resourceName);
@@ -335,8 +338,10 @@ public static Query fromProto(@Nonnull ReadRowsRequest request) {
Preconditions.checkArgument(request != null, "ReadRowsRequest must not be null");
String tableName = request.getTableName();
String authorizedViewName = request.getAuthorizedViewName();
+ String materializedViewName = request.getMaterializedViewName();
- Query query = new Query(NameUtil.extractTargetId(tableName, authorizedViewName));
+ Query query =
+ new Query(NameUtil.extractTargetId(tableName, authorizedViewName, materializedViewName));
query.builder = request.toBuilder();
return query;
diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java
index 08d9a3ca230b..d2a9dcb6a787 100644
--- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java
+++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java
@@ -44,7 +44,9 @@ public com.google.bigtable.v2.SampleRowKeysRequest toProto(RequestContext reques
com.google.bigtable.v2.SampleRowKeysRequest.newBuilder();
String resourceName =
targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId());
- if (targetId.scopedForAuthorizedView()) {
+ if (targetId.scopedForMaterializedView()) {
+ builder.setMaterializedViewName(resourceName);
+ } else if (targetId.scopedForAuthorizedView()) {
builder.setAuthorizedViewName(resourceName);
} else {
builder.setTableName(resourceName);
@@ -55,17 +57,19 @@ public com.google.bigtable.v2.SampleRowKeysRequest toProto(RequestContext reques
/**
* Wraps the protobuf {@link com.google.bigtable.v2.SampleRowKeysRequest}.
*
- * WARNING: Please note that the project id & instance id in the table/authorized view name
- * will be overwritten by the configuration in the BigtableDataClient.
+ * WARNING: Please note that the project id & instance id in the table/authorized
+ * view/materialized view name will be overwritten by the configuration in the BigtableDataClient.
*/
@InternalApi
public static SampleRowKeysRequest fromProto(
@Nonnull com.google.bigtable.v2.SampleRowKeysRequest request) {
String tableName = request.getTableName();
String authorizedViewName = request.getAuthorizedViewName();
+ String materializedViewName = request.getMaterializedViewName();
SampleRowKeysRequest sampleRowKeysRequest =
- SampleRowKeysRequest.create(NameUtil.extractTargetId(tableName, authorizedViewName));
+ SampleRowKeysRequest.create(
+ NameUtil.extractTargetId(tableName, authorizedViewName, materializedViewName));
return sampleRowKeysRequest;
}
diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java
index 15b2cd9d95e9..1b19e75d6903 100644
--- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java
+++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java
@@ -44,4 +44,10 @@ public String toResourceName(String projectId, String instanceId) {
public boolean scopedForAuthorizedView() {
return false;
}
+
+ @Override
+ @InternalApi
+ public boolean scopedForMaterializedView() {
+ return false;
+ }
}
diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java
index ae5be2359854..73860dc1d8b4 100644
--- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java
+++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java
@@ -40,8 +40,15 @@ public interface TargetId extends Serializable {
/**
* Returns true if this TargetId object represents id for an authorized view (rather than a
- * table).
+ * table/materialized view).
*/
@InternalApi
boolean scopedForAuthorizedView();
+
+ /**
+ * Returns true if this TargetId object represents id for an materialized view (rather than a
+ * table/authorized view).
+ */
+ @InternalApi
+ boolean scopedForMaterializedView();
}
diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java
index e9df27b43ae3..bd97b79d3711 100644
--- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java
+++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java
@@ -32,6 +32,8 @@
import com.google.bigtable.v2.MutateRowsResponse;
import com.google.bigtable.v2.PingAndWarmRequest;
import com.google.bigtable.v2.PingAndWarmResponse;
+import com.google.bigtable.v2.PrepareQueryRequest;
+import com.google.bigtable.v2.PrepareQueryResponse;
import com.google.bigtable.v2.ReadChangeStreamRequest;
import com.google.bigtable.v2.ReadChangeStreamResponse;
import com.google.bigtable.v2.ReadModifyWriteRowRequest;
@@ -92,6 +94,10 @@ public UnaryCallable{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * UpdateLogicalViewRequest request =
+ * UpdateLogicalViewRequest.newBuilder()
+ * .setLogicalView(LogicalView.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * LogicalView response = baseBigtableInstanceAdminClient.updateLogicalViewAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * UpdateLogicalViewRequest request =
+ * UpdateLogicalViewRequest.newBuilder()
+ * .setLogicalView(LogicalView.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * UpdateLogicalViewRequest request =
+ * UpdateLogicalViewRequest.newBuilder()
+ * .setLogicalView(LogicalView.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * LogicalViewName name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]");
+ * baseBigtableInstanceAdminClient.deleteLogicalView(name);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the logical view to be deleted. Format:
+ * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteLogicalView(LogicalViewName name) {
+ DeleteLogicalViewRequest request =
+ DeleteLogicalViewRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteLogicalView(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a logical view from an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * String name = LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString();
+ * baseBigtableInstanceAdminClient.deleteLogicalView(name);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the logical view to be deleted. Format:
+ * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteLogicalView(String name) {
+ DeleteLogicalViewRequest request = DeleteLogicalViewRequest.newBuilder().setName(name).build();
+ deleteLogicalView(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a logical view from an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * DeleteLogicalViewRequest request =
+ * DeleteLogicalViewRequest.newBuilder()
+ * .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString())
+ * .setEtag("etag3123477")
+ * .build();
+ * baseBigtableInstanceAdminClient.deleteLogicalView(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteLogicalView(DeleteLogicalViewRequest request) {
+ deleteLogicalViewCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a logical view from an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * DeleteLogicalViewRequest request =
+ * DeleteLogicalViewRequest.newBuilder()
+ * .setName(LogicalViewName.of("[PROJECT]", "[INSTANCE]", "[LOGICAL_VIEW]").toString())
+ * .setEtag("etag3123477")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * MaterializedView materializedView = MaterializedView.newBuilder().build();
+ * String materializedViewId = "materializedViewId682270903";
+ * MaterializedView response =
+ * baseBigtableInstanceAdminClient
+ * .createMaterializedViewAsync(parent, materializedView, materializedViewId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent instance where this materialized view will be created.
+ * Format: `projects/{project}/instances/{instance}`.
+ * @param materializedView Required. The materialized view to create.
+ * @param materializedViewId Required. The ID to use for the materialized view, which will become
+ * the final component of the materialized view's resource name.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+ * MaterializedView materializedView = MaterializedView.newBuilder().build();
+ * String materializedViewId = "materializedViewId682270903";
+ * MaterializedView response =
+ * baseBigtableInstanceAdminClient
+ * .createMaterializedViewAsync(parent, materializedView, materializedViewId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent instance where this materialized view will be created.
+ * Format: `projects/{project}/instances/{instance}`.
+ * @param materializedView Required. The materialized view to create.
+ * @param materializedViewId Required. The ID to use for the materialized view, which will become
+ * the final component of the materialized view's resource name.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * CreateMaterializedViewRequest request =
+ * CreateMaterializedViewRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setMaterializedViewId("materializedViewId682270903")
+ * .setMaterializedView(MaterializedView.newBuilder().build())
+ * .build();
+ * MaterializedView response =
+ * baseBigtableInstanceAdminClient.createMaterializedViewAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * CreateMaterializedViewRequest request =
+ * CreateMaterializedViewRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setMaterializedViewId("materializedViewId682270903")
+ * .setMaterializedView(MaterializedView.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ CreateMaterializedViewRequest, MaterializedView, CreateMaterializedViewMetadata>
+ createMaterializedViewOperationCallable() {
+ return stub.createMaterializedViewOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a materialized view within an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * CreateMaterializedViewRequest request =
+ * CreateMaterializedViewRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setMaterializedViewId("materializedViewId682270903")
+ * .setMaterializedView(MaterializedView.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * MaterializedViewName name =
+ * MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]");
+ * MaterializedView response = baseBigtableInstanceAdminClient.getMaterializedView(name);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the requested materialized view. Values are of the
+ * form `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final MaterializedView getMaterializedView(MaterializedViewName name) {
+ GetMaterializedViewRequest request =
+ GetMaterializedViewRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getMaterializedView(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a materialized view.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * String name =
+ * MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]").toString();
+ * MaterializedView response = baseBigtableInstanceAdminClient.getMaterializedView(name);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the requested materialized view. Values are of the
+ * form `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final MaterializedView getMaterializedView(String name) {
+ GetMaterializedViewRequest request =
+ GetMaterializedViewRequest.newBuilder().setName(name).build();
+ return getMaterializedView(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a materialized view.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * GetMaterializedViewRequest request =
+ * GetMaterializedViewRequest.newBuilder()
+ * .setName(
+ * MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]")
+ * .toString())
+ * .build();
+ * MaterializedView response = baseBigtableInstanceAdminClient.getMaterializedView(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final MaterializedView getMaterializedView(GetMaterializedViewRequest request) {
+ return getMaterializedViewCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a materialized view.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * GetMaterializedViewRequest request =
+ * GetMaterializedViewRequest.newBuilder()
+ * .setName(
+ * MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * for (MaterializedView element :
+ * baseBigtableInstanceAdminClient.listMaterializedViews(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The unique name of the instance for which the list of materialized
+ * views is requested. Values are of the form `projects/{project}/instances/{instance}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMaterializedViewsPagedResponse listMaterializedViews(InstanceName parent) {
+ ListMaterializedViewsRequest request =
+ ListMaterializedViewsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listMaterializedViews(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about materialized views in an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
+ * for (MaterializedView element :
+ * baseBigtableInstanceAdminClient.listMaterializedViews(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The unique name of the instance for which the list of materialized
+ * views is requested. Values are of the form `projects/{project}/instances/{instance}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMaterializedViewsPagedResponse listMaterializedViews(String parent) {
+ ListMaterializedViewsRequest request =
+ ListMaterializedViewsRequest.newBuilder().setParent(parent).build();
+ return listMaterializedViews(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about materialized views in an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * ListMaterializedViewsRequest request =
+ * ListMaterializedViewsRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (MaterializedView element :
+ * baseBigtableInstanceAdminClient.listMaterializedViews(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMaterializedViewsPagedResponse listMaterializedViews(
+ ListMaterializedViewsRequest request) {
+ return listMaterializedViewsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about materialized views in an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * ListMaterializedViewsRequest request =
+ * ListMaterializedViewsRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * ListMaterializedViewsRequest request =
+ * ListMaterializedViewsRequest.newBuilder()
+ * .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListMaterializedViewsResponse response =
+ * baseBigtableInstanceAdminClient.listMaterializedViewsCallable().call(request);
+ * for (MaterializedView element : response.getMaterializedViewsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * MaterializedView materializedView = MaterializedView.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * MaterializedView response =
+ * baseBigtableInstanceAdminClient
+ * .updateMaterializedViewAsync(materializedView, updateMask)
+ * .get();
+ * }
+ * }
+ *
+ * @param materializedView Required. The materialized view to update.
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * UpdateMaterializedViewRequest request =
+ * UpdateMaterializedViewRequest.newBuilder()
+ * .setMaterializedView(MaterializedView.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * MaterializedView response =
+ * baseBigtableInstanceAdminClient.updateMaterializedViewAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * UpdateMaterializedViewRequest request =
+ * UpdateMaterializedViewRequest.newBuilder()
+ * .setMaterializedView(MaterializedView.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ UpdateMaterializedViewRequest, MaterializedView, UpdateMaterializedViewMetadata>
+ updateMaterializedViewOperationCallable() {
+ return stub.updateMaterializedViewOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a materialized view within an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * UpdateMaterializedViewRequest request =
+ * UpdateMaterializedViewRequest.newBuilder()
+ * .setMaterializedView(MaterializedView.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * MaterializedViewName name =
+ * MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]");
+ * baseBigtableInstanceAdminClient.deleteMaterializedView(name);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the materialized view to be deleted. Format:
+ * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteMaterializedView(MaterializedViewName name) {
+ DeleteMaterializedViewRequest request =
+ DeleteMaterializedViewRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteMaterializedView(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a materialized view from an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * String name =
+ * MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]").toString();
+ * baseBigtableInstanceAdminClient.deleteMaterializedView(name);
+ * }
+ * }
+ *
+ * @param name Required. The unique name of the materialized view to be deleted. Format:
+ * `projects/{project}/instances/{instance}/materializedViews/{materialized_view}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteMaterializedView(String name) {
+ DeleteMaterializedViewRequest request =
+ DeleteMaterializedViewRequest.newBuilder().setName(name).build();
+ deleteMaterializedView(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a materialized view from an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * DeleteMaterializedViewRequest request =
+ * DeleteMaterializedViewRequest.newBuilder()
+ * .setName(
+ * MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]")
+ * .toString())
+ * .setEtag("etag3123477")
+ * .build();
+ * baseBigtableInstanceAdminClient.deleteMaterializedView(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteMaterializedView(DeleteMaterializedViewRequest request) {
+ deleteMaterializedViewCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a materialized view from an instance.
+ *
+ * {@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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+ * BaseBigtableInstanceAdminClient.create()) {
+ * DeleteMaterializedViewRequest request =
+ * DeleteMaterializedViewRequest.newBuilder()
+ * .setName(
+ * MaterializedViewName.of("[PROJECT]", "[INSTANCE]", "[MATERIALIZED_VIEW]")
+ * .toString())
+ * .setEtag("etag3123477")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable updateTableAsync(
* UpdateTableRequest.newBuilder()
* .setTable(Table.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
+ * .setIgnoreWarnings(true)
* .build();
* Table response = baseBigtableTableAdminClient.updateTableAsync(request).get();
* }
@@ -1004,6 +1006,7 @@ public final OperationFuture
updateTableAsync(
* UpdateTableRequest.newBuilder()
* .setTable(Table.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
+ * .setIgnoreWarnings(true)
* .build();
* OperationFuture
future =
* baseBigtableTableAdminClient.updateTableOperationCallable().futureCall(request);
@@ -1035,6 +1038,7 @@ public final OperationFuture
updateTableAsync(
* UpdateTableRequest.newBuilder()
* .setTable(Table.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
+ * .setIgnoreWarnings(true)
* .build();
* ApiFuture
{@code
+ * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+ * String tableId = "[TABLE]";
+ *
+ * Query query = Query.create(tableId)
+ * .range("[START KEY]", "[END KEY]")
+ * .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*"));
+ *
+ * // Iterator style
+ * try {
+ * for(CustomRow row : bigtableDataClient.skipLargeRowsCallable(new CustomRowAdapter()).call(query)) {
+ * // Do something with row
+ * }
+ * } catch (NotFoundException e) {
+ * System.out.println("Tried to read a non-existent table");
+ * } catch (RuntimeException e) {
+ * e.printStackTrace();
+ * }
+ * }
+ * }
+ *
+ * @see ServerStreamingCallable For call styles.
+ * @see Query For query options.
+ * @see com.google.cloud.bigtable.data.v2.models.Filters For the filter building DSL.
+ */
+ @InternalApi("only to be used by Bigtable beam connector")
+ public