Skip to content

feat: support configuring universe domain for BigtableConnection - #4624

Merged
mutianf merged 1 commit into
googleapis:mainfrom
mutianf:universe-domain-support
Aug 13, 2026
Merged

feat: support configuring universe domain for BigtableConnection#4624
mutianf merged 1 commit into
googleapis:mainfrom
mutianf:universe-domain-support

Conversation

@mutianf

@mutianf mutianf commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Add a new configuration key google.bigtable.universe.domain
(BIGTABLE_UNIVERSE_DOMAIN_KEY). When set, the universe domain is applied
to the data client, table admin client, and instance admin client via
StubSettings.setUniverseDomain in the shared connection configuration.

Change-Id: I7cf19844406a467c4ddc4cb02c35446706ad4daa
@mutianf
mutianf requested a review from a team as a code owner August 13, 2026 15:14
@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: bigtable Issues related to the googleapis/java-bigtable-hbase API. labels Aug 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for configuring a universe domain in the Bigtable HBase client by introducing the google.bigtable.universe.domain configuration key and applying it to both the data and admin clients. A unit test was also added to verify this behavior. The reviewer suggested avoiding the redundant use of Optional when retrieving the universe domain from the configuration to prevent unnecessary object allocation, and recommended a minor wording improvement in the debug log.

Comment on lines +475 to +484
Optional<String> universeDomain =
Optional.fromNullable(configuration.get(BIGTABLE_UNIVERSE_DOMAIN_KEY));

// Apply the universe domain to both the data client and the admin client. When set, the veneer
// resolves the endpoint from the universe domain unless an explicit host/port override is
// provided.
if (universeDomain.isPresent() && !Strings.isNullOrEmpty(universeDomain.get())) {
stubSettings.setUniverseDomain(universeDomain.get());
LOG.debug("%s is configured at %s", BIGTABLE_UNIVERSE_DOMAIN_KEY, universeDomain.get());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using Optional here is redundant and introduces unnecessary object allocation. Since we only need to check if the universe domain configuration is present and non-empty, we can directly retrieve the string from the configuration and use Strings.isNullOrEmpty(). Additionally, phrasing the log message as "configured to" or "is set to" is more natural for a domain name than "configured at" (which is typically used for endpoints/hosts).

    String universeDomain = configuration.get(BIGTABLE_UNIVERSE_DOMAIN_KEY);

    // Apply the universe domain to both the data client and the admin client. When set, the veneer
    // resolves the endpoint from the universe domain unless an explicit host/port override is
    // provided.
    if (!Strings.isNullOrEmpty(universeDomain)) {
      stubSettings.setUniverseDomain(universeDomain);
      LOG.debug("%s is configured to %s", BIGTABLE_UNIVERSE_DOMAIN_KEY, universeDomain);
    }

@mutianf
mutianf merged commit 287bcc2 into googleapis:main Aug 13, 2026
18 of 19 checks passed
@mutianf
mutianf deleted the universe-domain-support branch August 13, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/java-bigtable-hbase API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants