Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose new API with ReadRowsRequest in EnhancedBigtableStub #276

Merged
merged 2 commits into from May 11, 2020

Conversation

rahulKQL
Copy link
Contributor

@rahulKQL rahulKQL commented Apr 30, 2020

Fixes #275

This commit would enable the user to target the table using an absolute resource name on each read request. Currently, we expose ServerStreamingCallable<Query, RowT>, which does not have an option to provide different app-profile-id on each request.

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

…leStub

This commit would enable the user to target the table using absolute resource name on each read request. Currently we expose `ServerStreamingCallable<Query, RowT>`, which does not have an option to provide different `app-profile-id` on each request.
@rahulKQL rahulKQL requested review from igorbernstein2 and kolea2 Apr 30, 2020
@googlebot googlebot added the cla: yes label Apr 30, 2020
@codecov
Copy link

@codecov codecov bot commented Apr 30, 2020

Codecov Report

Merging #276 into master will decrease coverage by 0.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #276      +/-   ##
============================================
- Coverage     79.72%   79.52%   -0.21%     
- Complexity      991      992       +1     
============================================
  Files            99       99              
  Lines          6388     6447      +59     
  Branches        319      318       -1     
============================================
+ Hits           5093     5127      +34     
- Misses         1098     1119      +21     
- Partials        197      201       +4     
Impacted Files Coverage Δ Complexity Δ
...ud/bigtable/data/v2/stub/EnhancedBigtableStub.java 95.26% <100.00%> (+0.42%) 21.00 <3.00> (+1.00)
...d/bigtable/data/v2/models/MutateRowsException.java 75.00% <0.00%> (-8.34%) 3.00% <0.00%> (ø%)
...ata/v2/stub/readrows/FilterMarkerRowsCallable.java 83.87% <0.00%> (-6.46%) 2.00% <0.00%> (ø%)
...able/admin/v2/BaseBigtableInstanceAdminClient.java 57.07% <0.00%> (-3.14%) 56.00% <0.00%> (ø%)
...igtable/admin/v2/BaseBigtableTableAdminClient.java 58.18% <0.00%> (-1.98%) 67.00% <0.00%> (ø%)
.../admin/v2/stub/BigtableTableAdminStubSettings.java 94.26% <0.00%> (ø) 36.00% <0.00%> (ø%)
...min/v2/stub/BigtableInstanceAdminStubSettings.java 96.05% <0.00%> (ø) 33.00% <0.00%> (ø%)
...ble/data/v2/stub/EnhancedBigtableStubSettings.java 95.15% <0.00%> (+0.04%) 20.00% <0.00%> (ø%)
...d/bigtable/data/v2/stub/readrows/StateMachine.java 89.58% <0.00%> (+1.98%) 15.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67cbcf9...5d32c60. Read the comment docs.

Copy link
Contributor

@igorbernstein2 igorbernstein2 left a comment

This code is a bit hard to follow can we reorg it a bit?

ServerStreamingCallable<ReadRowsRequest,RowT> createBaseCallable(settings, adapter)

  • create the base chain with retries and row stitching

ServerStreamingCallable<ReadRowsRequest, RowT> createReadRowsRawCallable(adapter)

  • calls baseCallable
  • adds Context

createReadRowsCallable(adapter)

  • calls baseCallable
  • adds ReadRowsUserCallable
  • adds tracing + metrics
  • adds context

createReadRowsCallable(adapter)

  • calls baseCallable
  • adds ReadRowsUserCallable
  • first()
  • adds tracing + metrics
  • adds context

*
* <p>NOTE: the caller is responsible for adding tracing & metrics.
*/
public <RowT> ServerStreamingCallable<ReadRowsRequest, RowT> createReadRowsRawCallable(
Copy link
Contributor

@igorbernstein2 igorbernstein2 May 1, 2020

Choose a reason for hiding this comment

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

Please mark this as BetaApi and add a disclaimer that this method might be removed in the future

*
* <p>NOTE: the caller is responsible for adding tracing & metrics.
*/
public <RowT> ServerStreamingCallable<ReadRowsRequest, RowT> createReadRowsBaseCallable(
Copy link
Contributor

@igorbernstein2 igorbernstein2 May 1, 2020

Choose a reason for hiding this comment

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

This should not be public

With this commit, the public createReadRowsCallable() would refer to single createReadRowsBaseCallable.
Copy link
Contributor

@igorbernstein2 igorbernstein2 left a comment

lgtm

@rahulKQL rahulKQL merged commit 394efe4 into googleapis:master May 11, 2020
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants