GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Make refreshing channel compatible with BigtableDataClientFactory by mutianf · Pull Request #474 · googleapis/java-bigtable

This repository was archived by the owner on Aug 30, 2026. It is now read-only.

Conversation

@mutianf

@mutianf mutianf commented Oct 16, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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)

Fixes #458 ☕️

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mutianf
Make refreshing channel compatible with BigtableDataClientFactory
61d5e63
@mutianf
mutianf requested a review from a team October 16, 2020 23:16
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 16, 2020
@codecov

codecov Bot commented Oct 16, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #474 into master will increase coverage by 0.49%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #474      +/-   ##
============================================
+ Coverage     80.62%   81.11%   +0.49%     
- Complexity     1116     1124       +8     
============================================
  Files           106      106              
  Lines          6942     6965      +23     
  Branches        369      368       -1     
============================================
+ Hits           5597     5650      +53     
+ Misses         1147     1117      -30     
  Partials        198      198              
Impacted Files Coverage Δ Complexity Δ
...ble/data/v2/stub/EnhancedBigtableStubSettings.java 97.43% <ø> (+0.51%) 21.00 <0.00> (-1.00) ⬆️
...ud/bigtable/data/v2/BigtableDataClientFactory.java 95.65% <100.00%> (+0.09%) 9.00 <0.00> (ø)
...om/google/cloud/bigtable/emulator/v2/Emulator.java 60.65% <0.00%> (+0.81%) 14.00% <0.00%> (ø%)
...e/cloud/bigtable/data/v2/BigtableDataSettings.java 71.42% <0.00%> (+5.71%) 7.00% <0.00%> (ø%)
...ud/bigtable/admin/v2/BigtableTableAdminClient.java 84.58% <0.00%> (+12.41%) 44.00% <0.00%> (+9.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 a3bb371...d26e17a. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

yoshi-code-bot
yoshi-code-bot reviewed Oct 16, 2020
View reviewed changes

@yoshi-code-bot yoshi-code-bot left a comment

Copy link
Copy Markdown

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.

Some suggestions could not be made:

  • google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java
    • lines 26-26
  • google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java
    • lines 93-106

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mutianf
Fix formatting
45673db
@mutianf mutianf changed the title Make refreshing channel compatible with BigtableDataClientFactory fix: Make refreshing channel compatible with BigtableDataClientFactory Oct 16, 2020
@product-auto-label product-auto-label Bot added the api: bigtable Issues related to the googleapis/java-bigtable API. label Oct 17, 2020
@mutianf
mutianf force-pushed the issue458 branch from 054704c to c89aa60 Compare October 18, 2020 01:59
yoshi-code-bot
yoshi-code-bot reviewed Oct 18, 2020
View reviewed changes

@yoshi-code-bot yoshi-code-bot left a comment

Copy link
Copy Markdown

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.

Some suggestions could not be made:

  • google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java
    • lines 28-28

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mutianf
Fix test case
139254d
@mutianf
mutianf force-pushed the issue458 branch from c89aa60 to 139254d Compare October 18, 2020 02:04
kolea2
kolea2 reviewed Oct 19, 2020
View reviewed changes
Comment thread ...-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mutianf
Add ServerTransportFilter in FakeServiceHelper
2131123
@kolea2 kolea2 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 20, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 20, 2020
igorbernstein2
igorbernstein2 reviewed Oct 20, 2020
View reviewed changes
Comment thread ...loud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...table/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java Outdated
try {
channelProviderBuilder.setChannelPrimer(
BigtableChannelPrimer.create(
getCredentialsProvider().getCredentials(),

@igorbernstein2 igorbernstein2 Oct 20, 2020

Copy link
Copy Markdown
Contributor

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.

I think there is a subtle bug here:

If the original CredentialsProvider was a GoogleCredentialsProvider then each time getCredentials is called, it will be a new instance, which means the credentials used for refreshing will diverge from the normal request credentials.

I think you need to wrap reset the credentials to be FixedCredentials here.

Also please move the getCredentials line into its own try/catch its kinda hard to see which line can throw the IOException

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kolea2 kolea2 Oct 20, 2020

Copy link
Copy Markdown
Contributor

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.

To add here, can we add a test to ensure the credentials are consistent?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mutianf mutianf Oct 21, 2020

Copy link
Copy Markdown
Contributor Author

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.

Updated BigtableDataClientFactoryTest.testCreateWithRefreshingChannel test to verify that getCredentials is only called once by the credentialProvider we set (similar to test testNewClientsShareTransportChannel.testNewClientsShareTransportChannel). Also added a test in EnhancedBigtableStubSettingsTest to make sure it's returning the same credentials.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mutianf
Fix credentials provider settings add added test to verify it
2ff4007
igorbernstein2
igorbernstein2 approved these changes Oct 22, 2020
View reviewed changes

@igorbernstein2 igorbernstein2 left a comment

Copy link
Copy Markdown
Contributor

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.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java Outdated

@Override
public void transportTerminated(Attributes transportAttrs) {
attributes.add(transportAttrs);

@igorbernstein2 igorbernstein2 Oct 22, 2020

Copy link
Copy Markdown
Contributor

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.

Might be good to split termination attrs from setup attrs

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java Outdated
factory.createForAppProfile("other-appprofile");
factory.createForInstance("other-project", "other-instance");

// Make sure that only 1 instance is created by each provider

@igorbernstein2 igorbernstein2 Oct 22, 2020

Copy link
Copy Markdown
Contributor

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.

Make sure that only 1 instance is created for all clients

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mutianf
Clean up test cases and comments
d26e17a
@mutianf
mutianf merged commit fc74164 into googleapis:master Oct 22, 2020
gcf-merge-on-green Bot pushed a commit that referenced this pull request Oct 23, 2020
@release-please
chore: release 1.17.0 (#478)
d0f21a2
🤖 I have created a release \*beep\* \*boop\* 
---
## [1.17.0](https://www.github.com/googleapis/java-bigtable/compare/v1.16.2...v1.17.0) (2020-10-23)


### Features

* attemp DirectPath by default ([#467](https://www.github.com/googleapis/java-bigtable/issues/467)) ([89c622d](https://www.github.com/googleapis/java-bigtable/commit/89c622da6038067892687af3edafae743465eda7))
* backup level IAM ([#450](https://www.github.com/googleapis/java-bigtable/issues/450)) ([f38a8ec](https://www.github.com/googleapis/java-bigtable/commit/f38a8ecdc6164d081ef96f748ea37bd62b29b419))
* Implement toString for Bigtable*Settings ([#488](https://www.github.com/googleapis/java-bigtable/issues/488)) ([4d821f8](https://www.github.com/googleapis/java-bigtable/commit/4d821f85ceb237c8e449243ff8c80fb94e22ad51))


### Bug Fixes

* Make refreshing channel compatible with BigtableDataClientFactory ([#474](https://www.github.com/googleapis/java-bigtable/issues/474)) ([fc74164](https://www.github.com/googleapis/java-bigtable/commit/fc741645536e01fac772136bc8346f73ff95e600))


### Documentation

* fix formatting ([#476](https://www.github.com/googleapis/java-bigtable/issues/476)) ([eb24569](https://www.github.com/googleapis/java-bigtable/commit/eb24569e53f9d2b7fde50748c840c2c11f3f3c80))


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.12.1 ([#475](https://www.github.com/googleapis/java-bigtable/issues/475)) ([9e56edf](https://www.github.com/googleapis/java-bigtable/commit/9e56edfa7b0a78f14518a99130a7b319c5873be4))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.13.0 ([#484](https://www.github.com/googleapis/java-bigtable/issues/484)) ([aad648f](https://www.github.com/googleapis/java-bigtable/commit/aad648fec16b122092d394350822da742a2d7aa0))
* update dependency com.google.truth:truth to v1.1 ([#483](https://www.github.com/googleapis/java-bigtable/issues/483)) ([cca1e0e](https://www.github.com/googleapis/java-bigtable/commit/cca1e0e16f2ec0cc887d81c1844f5395ce08b6ea))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
ad548 pushed a commit to ad548/java-bigtable that referenced this pull request Mar 13, 2021
@mutianf @ad548
fix: Make refreshing channel compatible with BigtableDataClientFactory (
e80395c
googleapis#474)

Set up channel priming in EnhancedBigtableStubSettings when refreshingChannel is true. BigtableDataClientFactory will set up refreshing channels in the shared client context. Derivative clients cannot reconfigure this setting and will all have refreshing channels.
ad548 pushed a commit to ad548/java-bigtable that referenced this pull request Mar 13, 2021
@release-please @ad548
chore: release 1.17.0 (googleapis#478)
558c8f6
🤖 I have created a release \*beep\* \*boop\* 
---
## [1.17.0](https://www.github.com/googleapis/java-bigtable/compare/v1.16.2...v1.17.0) (2020-10-23)


### Features

* attemp DirectPath by default ([googleapis#467](https://www.github.com/googleapis/java-bigtable/issues/467)) ([89c622d](https://www.github.com/googleapis/java-bigtable/commit/89c622da6038067892687af3edafae743465eda7))
* backup level IAM ([googleapis#450](https://www.github.com/googleapis/java-bigtable/issues/450)) ([f38a8ec](https://www.github.com/googleapis/java-bigtable/commit/f38a8ecdc6164d081ef96f748ea37bd62b29b419))
* Implement toString for Bigtable*Settings ([googleapis#488](https://www.github.com/googleapis/java-bigtable/issues/488)) ([4d821f8](https://www.github.com/googleapis/java-bigtable/commit/4d821f85ceb237c8e449243ff8c80fb94e22ad51))


### Bug Fixes

* Make refreshing channel compatible with BigtableDataClientFactory ([googleapis#474](https://www.github.com/googleapis/java-bigtable/issues/474)) ([fc74164](https://www.github.com/googleapis/java-bigtable/commit/fc741645536e01fac772136bc8346f73ff95e600))


### Documentation

* fix formatting ([googleapis#476](https://www.github.com/googleapis/java-bigtable/issues/476)) ([eb24569](https://www.github.com/googleapis/java-bigtable/commit/eb24569e53f9d2b7fde50748c840c2c11f3f3c80))


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.12.1 ([googleapis#475](https://www.github.com/googleapis/java-bigtable/issues/475)) ([9e56edf](https://www.github.com/googleapis/java-bigtable/commit/9e56edfa7b0a78f14518a99130a7b319c5873be4))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.13.0 ([googleapis#484](https://www.github.com/googleapis/java-bigtable/issues/484)) ([aad648f](https://www.github.com/googleapis/java-bigtable/commit/aad648fec16b122092d394350822da742a2d7aa0))
* update dependency com.google.truth:truth to v1.1 ([googleapis#483](https://www.github.com/googleapis/java-bigtable/issues/483)) ([cca1e0e](https://www.github.com/googleapis/java-bigtable/commit/cca1e0e16f2ec0cc887d81c1844f5395ce08b6ea))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
@mutianf
mutianf deleted the issue458 branch April 10, 2021 00:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

3 more reviewers
@kolea2 kolea2 kolea2 left review comments
@yoshi-code-bot yoshi-code-bot yoshi-code-bot left review comments
@igorbernstein2 igorbernstein2 igorbernstein2 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: bigtable Issues related to the googleapis/java-bigtable API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ChannelRefreshing feature is incompatible with BigtableDataClientFactory

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@mutianf @igorbernstein2 @kolea2 @yoshi-code-bot @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.