Skip to content

Commit 9567312

Browse files
feat: introduce Bigtable Admin V2 clients for Selective GAPIC (#13173)
This PR introduces the modern `BigtableTableAdminClientV2` and `BigtableInstanceAdminClientV2` clients in `java-bigtable` as handwritten entry points for the Selective GAPIC hierarchy. It is a migration of the original PR from the split repository (googleapis/java-bigtable#2889) into the `google-cloud-java` monorepo. ## Key Changes ### 1. Core V2 Clients & Callables - **`BigtableInstanceAdminClientV2`**: Recreates the standardized admin entry point extending `BaseBigtableInstanceAdminClient`. - **`BigtableTableAdminClientV2`**: Recreates the administrative client extending `BaseBigtableTableAdminClient`. It relocates manual wrappers for Critical User Journeys (CUJs) like chained Long-Running Operations (`awaitOptimizeRestoredTable`) and consistency token polling (`waitForConsistency`). - **`AwaitConsistencyCallableV2`**: Implements a completely decoupled, lightweight utility callable for polling consistency tokens, ensuring the V2 administrative client stack has no compile-time dependency on the data client package. ### 2. Code Generation & POM Rules - **`owlbot.py`**: Added a post-processing rule to remove the `final` modifier from the `close()` method in `BaseBigtable*AdminClient` classes to allow handwritten subclass overrides. - **`pom.xml`**: Promoted the scope of `grpc-google-cloud-bigtable-admin-v2` from `test` to compile scope to support V2 admin gRPC descriptors and classes in production code. --------- Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
1 parent c91e9ce commit 9567312

13 files changed

Lines changed: 1448 additions & 2 deletions

java-bigtable/google-cloud-bigtable/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@
278278
<classifier>testlib</classifier>
279279
<scope>test</scope>
280280
</dependency>
281+
281282
<dependency>
282283
<groupId>com.google.api.grpc</groupId>
283284
<artifactId>grpc-google-cloud-bigtable-admin-v2</artifactId>

java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5249,7 +5249,7 @@ public final void deleteMaterializedView(DeleteMaterializedViewRequest request)
52495249
}
52505250

52515251
@Override
5252-
public final void close() {
5252+
public void close() {
52535253
stub.close();
52545254
}
52555255

java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6414,7 +6414,7 @@ public final UnaryCallable<DeleteSchemaBundleRequest, Empty> deleteSchemaBundleC
64146414
}
64156415

64166416
@Override
6417-
public final void close() {
6417+
public void close() {
64186418
stub.close();
64196419
}
64206420

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.cloud.bigtable.admin.v2;
17+
18+
import com.google.cloud.bigtable.admin.v2.stub.BigtableInstanceAdminStub;
19+
import java.io.IOException;
20+
21+
/**
22+
* Modern Cloud Bigtable Instance Admin Client.
23+
*
24+
* <p>This client extends the {@link BaseBigtableInstanceAdminClient} to provide a simplified and
25+
* enhanced API surface for managing Cloud Bigtable instances and clusters.
26+
*/
27+
public class BigtableInstanceAdminClientV2 extends BaseBigtableInstanceAdminClient {
28+
29+
protected BigtableInstanceAdminClientV2(BaseBigtableInstanceAdminSettings settings)
30+
throws IOException {
31+
super(settings);
32+
}
33+
34+
protected BigtableInstanceAdminClientV2(BigtableInstanceAdminStub stub) {
35+
super(stub);
36+
}
37+
38+
/** Constructs an instance of BigtableInstanceAdminClientV2 with the given settings. */
39+
public static final BigtableInstanceAdminClientV2 create(
40+
BaseBigtableInstanceAdminSettings settings) throws IOException {
41+
return new BigtableInstanceAdminClientV2(settings);
42+
}
43+
}

0 commit comments

Comments
 (0)