-
Notifications
You must be signed in to change notification settings - Fork 178
Data settings addition #1973
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
Data settings addition #1973
Conversation
|
@igorbernstein2 Please review |
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...ble-hbase/src/test/java/com/google/cloud/bigtable/hbase/TestBigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
igorbernstein2
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.
Looks like a good start. I added some comments. Please add inline TODOs for all settings that are currently unused
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
In this commit:
Would add test cases & removed unneeded comments once it gets reviewed. |
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
| .setRetrySettings(defaultRetrySettings(options)); | ||
| } else { | ||
| builder.readRowsSettings() | ||
| .setIdleTimeout(ofMillis(options.getRetryOptions().getReadPartialRowTimeoutMillis())) |
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 incorrect idleTimeout is the delay for the user leaving a stream open not the timeout for the server. You want to set the streamingWaitTimeout. There are 2 ways to do it:
- the rpcTimeout of the RetrySettings gets translated into a waitTimeout
- set it in calloptions
1 will work for when retries are enabled. However when retries are disabled, you would have to augment the calloptions at the callsite, which is awkward. Please open a ticket in gax-java to expose waitTimeout at the callable level
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 would open an issue stating this above scenario. Thanks
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
...igtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableDataSettingsFactory.java
Outdated
Show resolved
Hide resolved
|
@igorbernstein2 Could you please have a look at it. I will add more junit for it tomorrow. |
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
|
CLAs look good, thanks! |
ChangesBigtableVaneerSettingsFactory
TestBigtableVaneerSettingsFactory
Question:My purpose for using InstantiatingGrpcChannelProvider is to be able to create channelPools, however Should we use the BigtableSession#createChannelConfig as it takes care of creating ChannelPool? |
|
Please have a look at this and let me know of your thought. |
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVaneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVaneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVaneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
| * @param options a {@link BigtableOptions} object. | ||
| */ | ||
| private static void buildMutateRowSettings(Builder builder, BigtableOptions options) { | ||
| builder.mutateRowSettings() |
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.
where are the retry codes configured? (here and everywhere else)
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.
As of now, not overriding RetryCodes of BigtableDataSettings.
Defaults retrycode in GCJ:
[DEADLINE_EXCEEDED, UNAVAILABLE] --> sampleRowKeysSettings, readRowsSettings, mutateRowSettings.
empty for bulkMutationsSettings, readModifyWriteRowSettings, checkAndMutateRowSettings.
Default retrycodes in bigtable-client.
However, I can override these with operation specific retry codes.
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.
There are few more defaults for gcj in the overlay. The gapic generated client settings can't express all of the settings, so they are overlaid here:
https://github.com/googleapis/google-cloud-java/blob/master/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java#L273-L321
This is where bulkMutations have their defaults set.
I'm trying to understand why we shouldn't copy the retry codes from cbt?
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 for Non-idempotent operation we can utilize GCJ's default values, as we are overriding it with shortRpcTimeout & no retryCodes (here both adapters have the default value of 1 min).
In case of Idempotent operation default values varies alot &
- CBT has retryCode as
{DEADLINE_EXCEEDED, UNAVAILABLE, ABORTED, UNAUTHENTICATED} - GCJ's retryCodes are only
{DEADLINE_EXCEEDED, UNAVAILABLE}.
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVaneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVaneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVaneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
| adminBuilder.stubSettings() | ||
| .setCredentialsProvider(buildCredentialProvider(options.getCredentialOptions())); | ||
|
|
||
| String userAgent = BigtableVersionInfo.CORE_USER_AGENT + "," + options.getUserAgent(); |
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.
Please add something here that would allow us to disambiguate when the hbase client is using the gcj adapter
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.
Does "VENEER_ADAPTER" sound good?
bc64044 to
bffb90f
Compare
Summary of Client Settings changesAfter many Iteration now in this PR, as of now we are:
|
|
Please have a look & Please let me know if we need more modify any configurations. |
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
| //ChannelBuilder with provided value. | ||
| HeaderProvider headers = FixedHeaderProvider.create(USER_AGENT_KEY.name(), userAgent); | ||
|
|
||
| InstantiatingGrpcChannelProvider.Builder builder = |
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.
Please a TODO to refactor google-cloud-java to expose a static defaultTransportChannelProvider method and then customize it.
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
| * than 60_000 ms. | ||
| */ | ||
| private static void buildReadModifyWriteSettings(Builder builder, long rpcTimeoutMs) { | ||
| if(rpcTimeoutMs != SHORT_TIMEOUT_MS_DEFAULT) { |
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.
why if? (here and above)
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.
If shortTimeOutMs is at default then assuming the client did not customize BigtableOption's settings,
that is why we are not overriding the underlying settings here(or directly using defaults of GCJ's settings).
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 you should override with the BigtableOptions in case the diverge
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.
override with the BigtableOptions in case the diverge
By saying above comment,
do you mean we should check all configuration against their default value(present in BigtableOption) & then override only those which are different?
OR
Should we override only in case of specific operation(say non-streming operations) by checking BigtableOption's present value against BigtableDataSetting's default value?
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 just meant you should remove the if statement and always setSimpleTimeoutNoRetries disrarding if the if its the default value or not. If we decide that to change the gapic config to 30 secs, but forget to change SHORT_TIMEOUT_MS_DEFAULT we will have confusing behavior: the user will check their BigtableOptions and see SHORT_TIMEOUT_MS_DEFAULT = 1 minute, but their rpcs will exceed deadline @ 30secs
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 clarification!!
I followed the same here.
|
I just submitted googleapis/google-cloud-java#4507, it should help with the transport builder |
igorbernstein2
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.
LGTM, except for a couple of nits
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
...lient-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
Outdated
Show resolved
Hide resolved
| RetrySettings.Builder retryBuilder = retrySettings.toBuilder(); | ||
|
|
||
| if (retryOptions.allowRetriesWithoutTimestamp()) { | ||
| LOG.warn("Retries without Timestamp does not support yet."); |
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 should throw instead of warn
|
Will be just rebasing and updating these three last comments |
only adding fromBigtableOptions static method adding separate methods for each settings Added check for retry & remvoed unneeded setter
renamed Factory methods Reverted BulkMutationSettings changes refactored Credentail Provider
Used constant for maxRetryDelay & explicitly set the maxAttempts to zero
- Now using EnhancedBigtableDataSettings.defaultGrpcChannelPRovider for channel provider configuration. - Updated existed BigtableDataSetttings.Builder to EnhancedBigtableDataSettings.Builder. - changed user agent for vaneer adapter to lowercase. - throwing exception in case of allowRetriesWithoutTimestamp.
f918830 to
d98cd29
Compare
This commits contains:
BigtableOptionstoBigtableDataSettings.Note: This work is still in progress, opening PR for review purpose.