Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

refactor(samples): modernize Admin API examples to use auto-generated GAPIC client - #2829

Merged
jinseopkim0 merged 7 commits into
mainfrom
modernize-samples
Mar 2, 2026
Merged

refactor(samples): modernize Admin API examples to use auto-generated GAPIC client#2829
jinseopkim0 merged 7 commits into
mainfrom
modernize-samples

Conversation

@jinseopkim0

Copy link
Copy Markdown
Contributor

refactor(samples): modernize Admin API examples to use auto-generated GAPIC client

Refactors the Bigtable Admin API Java samples to use the modern, auto-generated proto-based methods via `getBaseClient()`. This aligns the samples with the ongoing effort to freeze the legacy handwritten
client and encourage the use of the underlying GAPIC client.

Specific changes:
* Updated `HelloWorld.java`, `TableAdminExample.java`, and `InstanceAdminExample.java` to call methods on the base GAPIC client instead of the legacy wrappers.
* Replaced legacy wrapper models with standard protobuf request objects (e.g., `com.google.bigtable.admin.v2.CreateTableRequest`, `com.google.bigtable.admin.v2.Instance`).
* Updated resource name strings to fully qualified formats (e.g., `projects/{project}/instances/{instance}`).
* Migrated garbage collection rule definitions to use the newly introduced `GcRuleBuilder`.
* Updated `InstanceAdminExampleTest.java` to remain compatible with the modified sample return types.

Tracking Bug: b/475818901

jinseopkim0 and others added 4 commits March 2, 2026 14:23
…surface

Adds getBaseClient() to BigtableInstanceAdminClient and marks all legacy handwritten veneer methods as @ObsoleteApi. This mirrors the recent changes to BigtableTableAdminClient in #2806.

Tracking Bug: b/475818901
… GAPIC client

Refactors the Bigtable Admin API Java samples to use the modern, auto-generated proto-based methods via `getBaseClient()`. This aligns the samples with the ongoing effort to freeze the legacy handwritten
client and encourage the use of the underlying GAPIC client.

Specific changes:
* Updated `HelloWorld.java`, `TableAdminExample.java`, and `InstanceAdminExample.java` to call methods on the base GAPIC client instead of the legacy wrappers.
* Replaced legacy wrapper models with standard protobuf request objects (e.g., `com.google.bigtable.admin.v2.CreateTableRequest`, `com.google.bigtable.admin.v2.Instance`).
* Updated resource name strings to fully qualified formats (e.g., `projects/{project}/instances/{instance}`).
* Migrated garbage collection rule definitions to use the newly introduced `GcRuleBuilder`.
* Updated `InstanceAdminExampleTest.java` to remain compatible with the modified sample return types.

Tracking Bug: b/475818901
@product-auto-label product-auto-label Bot added size: l Pull request size is large. api: bigtable Issues related to the googleapis/java-bigtable API. samples Issues that are directly related to samples. labels Mar 2, 2026
@jinseopkim0
jinseopkim0 changed the base branch from main to gapic2 March 2, 2026 20:07
@jinseopkim0
jinseopkim0 marked this pull request as ready for review March 2, 2026 20:17
@jinseopkim0
jinseopkim0 requested a review from lqiu96 March 2, 2026 20:28
Base automatically changed from gapic2 to main March 2, 2026 20:41
@jinseopkim0
jinseopkim0 requested review from a team as code owners March 2, 2026 20:41
@jinseopkim0 jinseopkim0 added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Mar 2, 2026
@jinseopkim0
jinseopkim0 merged commit c28a3a1 into main Mar 2, 2026
28 checks passed
@jinseopkim0
jinseopkim0 deleted the modernize-samples branch March 2, 2026 22:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigtable Issues related to the googleapis/java-bigtable API. kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. samples Issues that are directly related to samples. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants