Skip to content

feat(bigtable): route point read rows to shim#13542

Merged
mutianf merged 3 commits into
googleapis:mainfrom
mutianf:stream
Jun 23, 2026
Merged

feat(bigtable): route point read rows to shim#13542
mutianf merged 3 commits into
googleapis:mainfrom
mutianf:stream

Conversation

@mutianf

@mutianf mutianf commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@mutianf mutianf requested review from a team as code owners June 23, 2026 02:57

@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 introduces MaybePointReadCallable to route single-point ReadRows queries through a unary point-read callable, allowing them to benefit from session-shim optimizations. It also adds helper methods in Query to identify single-point queries and updates EnhancedBigtableStub to integrate this new routing logic. The reviewer feedback highlights several critical improvements: addressing potential synchronous exceptions and cancellation handling in MaybePointReadCallable to comply with the ResponseObserver contract, and properly propagating custom retryableCodes when routing ReadRows calls to point reads.

@mutianf

mutianf commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 introduces MaybePointReadCallable to optimize ReadRows calls by routing single-row point queries through a unary point-read callable, allowing them to benefit from session-shim optimizations. It also adds helper methods in Query to identify single-point queries and extracts a reusable createPointReadCallable helper in EnhancedBigtableStub. A critical bug was identified in EnhancedBigtableStub where the locally created readRowsCallable is ignored in favor of the class field readRowCallable, bypassing the custom retry settings and row adapter.

@@ -302,16 +327,20 @@ public <RowT> UnaryCallable<Query, RowT> createReadRowCallable(RowAdapter<RowT>
BigtableUnaryOperationCallable<Query, RowT> classic =
new BigtableUnaryOperationCallable<>(
readRowCallable,

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.

high

There is a bug here where the locally created readRowsCallable (which is configured with the correct retrySettings, retryableCodes, and rowAdapter) is ignored. Instead, the class field readRowCallable is passed to BigtableUnaryOperationCallable. This causes the custom retry settings and the generic rowAdapter to be bypassed. Please update this to use readRowsCallable.

Suggested change
readRowCallable,
readRowsCallable,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think this review is right. readRows callable is converted to readRow callable with Transforming callable.

mutianf added 2 commits June 23, 2026 15:01
Switch annotations and imports to org.junit.jupiter so the test fits the
project's existing JUnit 5 conventions.

@igorbernstein2 igorbernstein2 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.

lgtm, but please think about the effects of the settings change

@mutianf mutianf merged commit 2c7e5f5 into googleapis:main Jun 23, 2026
203 checks passed
@mutianf mutianf deleted the stream branch June 23, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants