-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[Bigtable] Migrate BigtableIO to use the veneer client under the hood #24015
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24015 +/- ##
==========================================
+ Coverage 72.79% 72.81% +0.02%
==========================================
Files 775 775
Lines 102840 102928 +88
==========================================
+ Hits 74864 74949 +85
- Misses 26522 26525 +3
Partials 1454 1454
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Assigning reviewers. If you would like to opt out of this review, comment R: @kennknowles for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
diegomez17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed BigtableServiceImpl and it's tests.
...le-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java
Outdated
Show resolved
Hide resolved
...le-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java
Outdated
Show resolved
Hide resolved
...le-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java
Outdated
Show resolved
Hide resolved
...le-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java
Outdated
Show resolved
Hide resolved
...le-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java
Outdated
Show resolved
Hide resolved
...le-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java
Outdated
Show resolved
Hide resolved
.../google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIOTest.java
Outdated
Show resolved
Hide resolved
.../google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIOTest.java
Outdated
Show resolved
Hide resolved
.../google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIOTest.java
Outdated
Show resolved
Hide resolved
...loud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImplTest.java
Outdated
Show resolved
Hide resolved
|
Reminder, please take a look at this pr: @kennknowles @Abacn @Abacn |
|
Thanks for the work! Looking into it. |
...-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableClientWrapper.java
Show resolved
Hide resolved
Abacn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some initial comments. Not yet finished (now at BigtableHBaseVeneeringSettings)
.../google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableConfig.java
Outdated
Show resolved
Hide resolved
...atform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableHBaseVeneeringSettings.java
Outdated
Show resolved
Hide resolved
|
Reminder, please take a look at this pr: @kennknowles @Abacn @Abacn |
|
waiting on author |
|
Hi @Abacn , this pr is ready for review, can you take a look? @igorbernstein2 from my team already took a look and thinks it looks good. Thanks! |
|
Thanks @mutianf, will looking into it tomorrow |
Abacn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good to me. Would you mind open a GitHub Issue for this PR for tracking, and adding an announcement in CHANGES.md ?https://github.com/apache/beam/blob/master/CHANGES.md?plain=1#L70
| } | ||
|
|
||
| /** Tests that credentials are used from PipelineOptions if not supplied by BigtableOptions. */ | ||
| @Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering the purpose of removing these unit tests, is it because the scenario is no longer applicable for the new client, or are there any breaking change / regression could be introduced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. The way we get BigtableService is different now so these tests are no longer applicable. I moved the tests to BigtableConfigTranslator which will test the same behavior, PTAL, thanks! 97e96e8#diff-b53a99acd5a4cd30f4b76e8b94f7cd09df6f0fc196d949842d20bc845b48661c
Abacn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the prompt fix. Reviewed tests. If the change is not trivial good to have other reviewes to take another look for main source change.
| CredentialFactory credentialFactory = config.getCredentialFactory(); | ||
| try { | ||
| // Skip resetting the credentials if it's connected to an emulator | ||
| if (!emulator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the code path is made different intentionally for test and real use cases. Does this cause the if {} clause no longer covered by unit test where it was intended to be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still covered by testUsingPipelineOptionsCredential and testUsingCredentialsFromBigtableOptions in BigtableConfigTranslatorTest to make sure the credentials are updated correctly. The emulator test case is tested by the sql tests.
CHANGES.md
Outdated
| * Support for X source added (Java/Python) ([#X](https://github.com/apache/beam/issues/X)). | ||
| * Added in JmsIO a retry policy for failed publications (Java) ([#24971](https://github.com/apache/beam/issues/24971)). | ||
| * Support for `LZMA` compression/decompression of text files added to the Python SDK ([#25316](https://github.com/apache/beam/issues/25316)) | ||
| * Update BigtableIO to use the idiomatic bigtable client under the hood (Java) ([25592](https://github.com/apache/beam/issues/25592)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this won't be in Beam 2.46.0. We can remove it here and insert to the proper line again as a follow up PR after this is in.
Sounds good, thanks @Abacn! I'll have Igor review it again after he's back from vacation next week. |
...oud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableConfigTranslator.java
Outdated
Show resolved
Hide resolved
...oud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableConfigTranslator.java
Show resolved
Hide resolved
...a/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
Show resolved
Hide resolved
...a/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
Outdated
Show resolved
Hide resolved
...a/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
Outdated
Show resolved
Hide resolved
...a/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
Outdated
Show resolved
Hide resolved
| for (SampleRowKeysResponse response : sampleRowKeys) { | ||
| ByteKey responseEndKey = makeByteKey(response.getRowKey()); | ||
| long responseOffset = response.getOffsetBytes(); | ||
| for (KeyOffset keyOffset : sampleRowKeys) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a followup PR, we should migrate the splitting logic to the utils in veneer (also we should fix the logic in veneer to use split points as inclusive endpoints...it currently uses the split points as inclusive start points)
| } | ||
| } | ||
|
|
||
| @ProcessElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This DoFn has a bunch of additional logic for checking for failures, in a future PR we should just use the error tracking veneer's batching logic
|
Run PostCommit_Java_DataflowV2 |
|
Run PostCommit_Java_Dataflow |
|
Run Java PreCommit |
|
postcommit tests passed. Two failing precommit suites due to known flakes. Merging for now. |
Migrate BigtableIO to use the java veneer client under the hood. In the future, we'll move to java-bigtable-hbase 2.x versions and deprecate bigtable-client-core.
The new code has the following structure:
BigatableConfig- defines the client connection level settingsBigtableReadOptionsandBigtableWriteOptions- defines the tables to read / write and their timeout settingsBigtableOptionsBigtableIO.ReadorBigtableIO.Writewith the same configuration will share the sameBigtableService. The service is cached inBigtableServiceFactory. Whenever we instantiating a newBigtableService, translate all the configurations includingBigtableOptionsto bigtable veneer settings.Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.