-
Notifications
You must be signed in to change notification settings - Fork 88
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: introduce java.time
#2415
base: main
Are you sure you want to change the base?
Conversation
…ava-bigtable into introduce-java-time
…ds + nanos)" This reverts commit a7746ad.
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Type.java
Show resolved
Hide resolved
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/SqlType.java
Outdated
Show resolved
Hide resolved
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/Statement.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingServerStreamingCallable.java
Show resolved
Hide resolved
...-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryInfoRetryAlgorithm.java
Show resolved
Hide resolved
google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java
Outdated
Show resolved
Hide resolved
no changes in admin, everything is reset to the latest of main
…ava-bigtable into introduce-java-time
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. Bigtable team for final approval
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 reviewed the following:
- common/Type.java
- data/v2/BigtableDataSettings.java
- data/v2/stub
- data/v2/metrics
- gaxx/retrying
- and tests related to these changes.
@@ -124,9 +123,10 @@ public void attemptCancelled() { | |||
} | |||
} | |||
|
|||
public void attemptFailed(Throwable error, Duration delay) { |
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.
Instead of deleting this method, should attemptFailled call attemptFailedDuration?
@@ -38,7 +38,7 @@ public class BigtableBatchingCallSettingsTest { | |||
BatchingSettings.newBuilder() | |||
.setElementCountThreshold(10L) | |||
.setRequestByteThreshold(20L) | |||
.setDelayThreshold(Duration.ofMillis(5)) |
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.
Im wondering if we should keep the test code the same so that we can verify these settings are ported to the new settings correctly? We can leave a todo to update them in a separate PR.
@@ -149,11 +149,11 @@ public void testAttemptCancelled() { | |||
public void testAttemptFailed() { | |||
RuntimeException error = new RuntimeException(); | |||
Duration delay = Duration.ofMillis(10); | |||
compositeTracer.attemptFailed(error, delay); |
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.
same here, I think we should keep calling attemptFailed and verify attemptFailedDuration gets called?
This PR introduces
java.time
alternatives to existingorg.threeten.bp.*
methods, as well as switching internal variables (if any) tojava.time
The main constraint is to keep the changes backwards compatible, so for each existing threeten method "
method1(org.threeten.bp.Duration)
" we will add an alternative with a Duration (or Timestamp when applicable) suffix: "method1Duration(java.time.Duration)
".For most cases, the implementation will be held in the
java.time
method and the old threeten method will just delegate the call to it. However, for the case of abstract classes, the implementation will be kept in the threeten method to avoid breaking changes (i.e. users that already overloaded the method in their user code).Note: https://cloud.google.com/bigtable/docs/reference/sql/data-types#timestamp_type implies that nanosecond precision will be ignored.