Skip to content

feat(bigtable): support DirectPath in Cloud Bigtable C++ client#16088

Merged
scotthart merged 3 commits intogoogleapis:mainfrom
elinorli:quickstart
May 4, 2026
Merged

feat(bigtable): support DirectPath in Cloud Bigtable C++ client#16088
scotthart merged 3 commits intogoogleapis:mainfrom
elinorli:quickstart

Conversation

@elinorli
Copy link
Copy Markdown
Contributor

Extract DirectPath checking logic into a reusable IsDirectPath() function and update option defaults and metadata flags:

  • Extract environment variable checking logic to bigtable::internal::IsDirectPath()
  • Check both GOOGLE_CLOUD_ENABLE_DIRECT_PATH and CBT_ENABLE_DIRECTPATH
  • Set c2p:///bigtable.googleapis.com as the endpoint when DirectPath is enabled
  • Do not limit channel counts to 1 when DirectPath is enabled
  • Update features metadata in the stub factory to request DirectPath when enabled
  • Add test coverage for new environment variable checks and feature flags

@elinorli elinorli requested a review from a team as a code owner April 30, 2026 18:25
@product-auto-label product-auto-label Bot added the api: bigtable Issues related to the Bigtable API. label Apr 30, 2026
Copy link
Copy Markdown

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

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 introduces support for the CBT_ENABLE_DIRECTPATH environment variable, updates the Direct Path endpoint to c2p:///bigtable.googleapis.com, and removes the single-channel restriction for Direct Path. It also adds logic to include specific feature flags in the bigtable-features metadata when Direct Path is active. A critical memory leak was identified in FeaturesMetadata() because the static keyword was removed from a heap-allocated variable; this should be corrected by restoring the static qualifier and moving the environment check inside the initialization lambda.

Comment thread google/cloud/bigtable/internal/bigtable_stub_factory.cc Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 98.63014% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.70%. Comparing base (d48786e) to head (4984937).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ud/bigtable/internal/bigtable_stub_factory_test.cc 97.29% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16088      +/-   ##
==========================================
- Coverage   92.70%   92.70%   -0.01%     
==========================================
  Files        2353     2353              
  Lines      218231   218352     +121     
==========================================
+ Hits       202313   202421     +108     
- Misses      15918    15931      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread google/cloud/bigtable/internal/bigtable_stub_factory.cc Outdated
Comment thread google/cloud/bigtable/internal/defaults.cc
@elinorli elinorli requested a review from scotthart May 1, 2026 20:04
elinorli added 3 commits May 4, 2026 15:50
Extract DirectPath checking logic into a reusable `IsDirectPath()`
function and update option defaults and metadata flags:

- Extract environment variable checking logic to `bigtable::internal::IsDirectPath()`
- Check both `GOOGLE_CLOUD_ENABLE_DIRECT_PATH` and `CBT_ENABLE_DIRECTPATH`
- Set `c2p:///bigtable.googleapis.com` as the endpoint when DirectPath is enabled
- Do not limit channel counts to 1 when DirectPath is enabled
- Update features metadata in the stub factory to request DirectPath when enabled
- Add test coverage for new environment variable checks and feature flags
Extract DirectPath checking logic into a reusable `IsDirectPath()`
function and update option defaults and metadata flags:

- Extract environment variable checking logic to `bigtable::internal::IsDirectPath()`
- Check both `GOOGLE_CLOUD_ENABLE_DIRECT_PATH` and `CBT_ENABLE_DIRECTPATH`
- Set `c2p:///bigtable.googleapis.com` as the endpoint when DirectPath is enabled
- Do not limit channel counts to 1 when DirectPath is enabled
- Update features metadata in the stub factory to request DirectPath when enabled
- Add test coverage for new environment variable checks and feature flags
Extract DirectPath checking logic into a reusable `IsDirectPath()`
function and update option defaults and metadata flags:

- Extract environment variable checking logic to `bigtable::internal::IsDirectPath()`
- Check both `GOOGLE_CLOUD_ENABLE_DIRECT_PATH` and `CBT_ENABLE_DIRECTPATH`
- Set `c2p:///bigtable.googleapis.com` as the endpoint when DirectPath is enabled
- Do not limit channel counts to 1 when DirectPath is enabled
- Update features metadata in the stub factory to request DirectPath when enabled
- Add test coverage for new environment variable checks and feature flags
@scotthart scotthart enabled auto-merge (squash) May 4, 2026 20:35
@scotthart scotthart merged commit 3852865 into googleapis:main May 4, 2026
53 of 59 checks passed
@elinorli elinorli deleted the quickstart branch May 4, 2026 21:39
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 Bigtable API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants