This repository was archived by the owner on May 14, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
feat: Introduce java.time to Gax-Java #1872
Merged
Merged
Changes from all commits
Commits
Show all changes
158 commits
Select commit
Hold shift + click to select a range
212dcfa
chore: initial conversion to java.time in gax production classes
diegomarquezp 62ae4ef
chore: initial conversion to java.time in gax test classes
diegomarquezp 484fd74
chore: use java.time conversion util
diegomarquezp 455b61b
chore: fmt
diegomarquezp c5eee47
chore: restore mistake in search/replace
diegomarquezp ef83e0d
chore: ignore java time / threeten differences
diegomarquezp ee31831
chore: adapt tests
diegomarquezp f6b3fd7
chore: adapt tests
diegomarquezp b50b585
Merge branch 'threeten-deprecation-gax' into threeten-deprecation
diegomarquezp 521c8fb
chore: fix expected output using Duration in tests
diegomarquezp 63b882d
chore: fix clirr in other projects
diegomarquezp 774139a
chore: internal usage of java.time in gax
diegomarquezp 0be22ab
chore: adapt builder of `retrying`
diegomarquezp 03a9f65
chore: adapt builders in `gax`
diegomarquezp 523d100
chore: adapt builders in `gax-grpc`
diegomarquezp 43f3077
chore: adapt builders in `gax-httpjson`
diegomarquezp d4d1428
feat: Introduce @ObsoleteApi
blakeli0 e261058
chore: format
blakeli0 490b214
Update api-common-java/src/main/java/com/google/api/core/ObsoleteApi.…
blakeli0 a1a0136
Update api-common-java/src/main/java/com/google/api/core/ObsoleteApi.…
blakeli0 8fda898
chore: format
blakeli0 7879446
chore: Rename value to description.
blakeli0 5e2c20e
doc: Add a blurb in README.md
blakeli0 3945a98
doc: Update wording.
blakeli0 5e9c638
doc: Update wording.
blakeli0 0b5d5e6
doc: Update wording.
blakeli0 2e07a48
chore: rename description to value.
blakeli0 e6c20b7
chore: adapt builders in `google-cloud-core`
diegomarquezp d7b0cf3
chore: format
diegomarquezp 5cf1289
chore: fix tests in gax/gax
diegomarquezp 44b45d3
Merge remote-tracking branch 'origin/add-obsolete-api' into threeten-…
diegomarquezp 8e221c1
chore: add @ObsoleteApi annotation
diegomarquezp 667f2da
chore: revert changes in gapic-generator-java
diegomarquezp 6113cea
chore: changes in `Instant`
diegomarquezp 9992618
chore: use java.time methods on builders
diegomarquezp e8a871b
chore: restore `RetrySettingsComposer`
diegomarquezp fbad4ee
Merge remote-tracking branch 'origin/main' into threeten-deprecation
diegomarquezp 751ba06
Merge remote-tracking branch 'origin/main' into threeten-deprecation
diegomarquezp e20f974
chore: use local repository for api-common
diegomarquezp f05f2ef
chore: use local repository
diegomarquezp 1cf298c
Merge remote-tracking branch 'origin/main' into threeten-deprecation
diegomarquezp 4703dcd
format source
diegomarquezp 4635dd5
add test for retry settings propagation
diegomarquezp 7774eb0
restore bazel configurations
diegomarquezp 63261fa
rename time objects test
diegomarquezp ba456a1
add generic test for time modifier methods
diegomarquezp 2330496
Merge remote-tracking branch 'origin/main' into threeten-deprecation
diegomarquezp 23c9ac4
Merge branch 'main' into threeten-deprecation
diegomarquezp 6920222
post-merge fixes
diegomarquezp 0c8ac5d
add tests for GrpcCallContext
diegomarquezp 0c8cfb7
add tests for InstantiatingGrpcChannelProvider
diegomarquezp f9750ce
add HttpJsonCallContext tests
diegomarquezp 351f829
modify tests for GrpcCallContext
diegomarquezp 1be5153
modify InstantiatingGrpcChannelProvider test
diegomarquezp f84b521
add tests for HttpJsonCallOptions
diegomarquezp 31ab5e0
rename to testDurationMethod()
diegomarquezp 8fc424d
reformat
diegomarquezp c3bc83f
add annotation based test for autovalue classes
diegomarquezp 16fa545
add reflection test for httpjson
diegomarquezp 4fd48d4
adapt tests of ThresholdBatcher
diegomarquezp 5dca441
add test for RetrySettings
diegomarquezp a58f1bf
use custom annotation for autovalues with default test values
diegomarquezp fc2ee3b
Revert "use custom annotation for autovalues with default test values"
diegomarquezp 6576921
Revert "add test for RetrySettings"
diegomarquezp aa11c88
Revert "adapt tests of ThresholdBatcher"
diegomarquezp 203960a
Revert "add reflection test for httpjson"
diegomarquezp 5c07021
Revert "add annotation based test for autovalue classes"
diegomarquezp 6c15c4c
simplify test helpers
diegomarquezp e48decf
add tests for HttpJsonCallOptions
diegomarquezp 7c8a644
add tests for BatchingSettingsTest
diegomarquezp 21e4240
add test for ThresholdBatcher
diegomarquezp 8d96c61
add tests for retry settings
diegomarquezp eefff2a
chore: reformat
diegomarquezp 233ce62
add tests for TimedAttemptSettings
diegomarquezp f55cf09
fix HttpJsonClientCall test
diegomarquezp 6b437c1
add license headers to tests
diegomarquezp 11043d4
add tests for ClientContext
diegomarquezp d3ebac5
add tests for ClientSettings
diegomarquezp 50b0ffd
add tests for FixedWatchdogProvider
diegomarquezp 21c03bd
fix internal java.time methods in WatchDog related classes
diegomarquezp 16933f0
add tests for ServerStreamingCallSettings
diegomarquezp 33a42bd
add tests for StubSettings
diegomarquezp bca5067
add test for UnaryCallSettings
diegomarquezp c1b91ee
reformat settings test
diegomarquezp 173dc2e
add tests in tracing
diegomarquezp c8dc5f0
Merge branch 'main' into threeten-deprecation
diegomarquezp 6abced3
remove unnecessary mocks
diegomarquezp 31792f7
add license for metrics test utils
diegomarquezp a67cca5
add clirr ignore for api tracer
diegomarquezp a87d2b8
rename overloaded setters in ApiContext
diegomarquezp 3b3d45a
rename overload method in InstantiatingGrpcChannelProvider
diegomarquezp eea294e
fix obsolete api annotations in apicallcontext
diegomarquezp 48cd5e9
rename overload of HttpJsonCallOptions
diegomarquezp 060c1fa
rename overload of BatchingSettings
diegomarquezp 67000c7
modify overload of ThresholdBatcher
diegomarquezp 9266ad0
fix wrong getter name in exp retry algo
diegomarquezp 4ee554f
modify overloads in RetrySettings
diegomarquezp 75668a5
modify overloads in TimedAttemptSettings
diegomarquezp 964625f
modify overloads of ClientContext
diegomarquezp 1c0df23
modify overloads in ClientSettings
diegomarquezp 53d2131
modify overloads for watchdogs
diegomarquezp 587f060
modify overloads of ServerStreamingCallSettings
diegomarquezp 427d295
modify overloads of StubSettings
diegomarquezp 9f51822
modify overloads for UnaryCallSettings
diegomarquezp 2a4949b
modify overloads in ApiTracer
diegomarquezp 60a43dd
reformat
diegomarquezp 24c1566
reset java-core and showcase to main
diegomarquezp 786c915
remove showcase IT
diegomarquezp a99d3c1
fix clirr and compilation
diegomarquezp 7e64fc1
fix compileation issues
diegomarquezp 75d038c
fix comments
diegomarquezp 582668c
Merge remote-tracking branch 'origin/main' into threeten-deprecation
diegomarquezp f252f95
Merge remote-tracking branch 'origin/main' into threeten-deprecation
diegomarquezp f450e33
Revert "remove showcase IT"
diegomarquezp b276f07
reformat showcase test
diegomarquezp bd273a5
use java.time internal variables
diegomarquezp 3c9edbb
Merge branch 'main' into threeten-deprecation
diegomarquezp d999fe3
Merge remote-tracking branch 'origin/threeten-deprecation' into three…
diegomarquezp 5dbff0f
remove overloads for deprecated method in HttpJsonCallContext
diegomarquezp a579c0d
Add overload for Watchdog.create
diegomarquezp 6755cb8
remove InternalApi from WatchdogProvider
diegomarquezp 5d3df79
Noop for ApiTracer.attemptFailed
diegomarquezp 175aeb3
Noop for BaseApiTracer.attemptFailed
diegomarquezp f9ece6f
remove testing getters in ThresholdBatcher
diegomarquezp 02833c3
format
diegomarquezp 389a520
suggest alternative method in javadoc
diegomarquezp 5d945b3
more javadoc editions
diegomarquezp a21c678
fix public methods in Watchdog
diegomarquezp f17747b
Merge remote-tracking branch 'origin/main' into threeten-deprecation
diegomarquezp ed838ad
format
diegomarquezp 5b51530
clirr fixes
diegomarquezp 7091186
correct import
diegomarquezp 3f7ac57
correct interface usage
diegomarquezp a23c041
Merge branch 'threeten-deprecation' of https://github.com/googleapis/…
diegomarquezp 2158334
fix junit imports
diegomarquezp 98fdeb3
add default behavior to WatchdogProvider
diegomarquezp 7604897
fix IT
diegomarquezp 4976270
Merge remote-tracking branch 'origin/threeten-deprecation' into three…
diegomarquezp 59c4dbb
increase coverate in AttemptCallableTest
diegomarquezp 8bbf01f
add tests for BaseApiTracer
diegomarquezp 038d16b
increase coverage for BasicRetryingFuture
diegomarquezp aa601fd
increase coverage of BatcherFactory
diegomarquezp ffebe03
format + increase coverage in BatcherImpl
diegomarquezp c0957df
add javadoc for TimeConversionTestUtils
diegomarquezp 6359ef4
increase coverage in Callables
diegomarquezp 5167ab1
increase coverage in CheckingAttemptCallable
diegomarquezp dd9a1b3
add null check in ClientSettings
diegomarquezp 1212fa7
use manual test in BatchingSettingsTest
diegomarquezp be18870
format
diegomarquezp ec6c52e
add tests with same settings builder and different test value
diegomarquezp d5ce8b1
chore: Add @{argLine} to prevent overwriting jacoco property
lqiu96 aeadeb8
restore BatchingSettingsTest
diegomarquezp 468558b
Update gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjso…
diegomarquezp 5384591
Merge remote-tracking branch 'origin/threeten-deprecation' into three…
diegomarquezp 82c0679
use java.time methods in HttpJsonClientCalls
diegomarquezp 09e9995
add tests for TimeConversionUtils
diegomarquezp 57170d0
add license header
diegomarquezp 1ad1ad3
Merge branch 'main' into threeten-deprecation
diegomarquezp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -29,9 +29,13 @@ | |||||||||
| */ | ||||||||||
| package com.google.api.gax.grpc; | ||||||||||
|
|
||||||||||
| import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; | ||||||||||
| import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; | ||||||||||
|
|
||||||||||
| import com.google.api.core.ApiFunction; | ||||||||||
| import com.google.api.core.BetaApi; | ||||||||||
| import com.google.api.core.InternalApi; | ||||||||||
| import com.google.api.core.ObsoleteApi; | ||||||||||
| import com.google.api.gax.core.ExecutorProvider; | ||||||||||
| import com.google.api.gax.rpc.FixedHeaderProvider; | ||||||||||
| import com.google.api.gax.rpc.HeaderProvider; | ||||||||||
|
|
@@ -67,7 +71,6 @@ | |||||||||
| import java.util.logging.Logger; | ||||||||||
| import javax.annotation.Nullable; | ||||||||||
| import javax.net.ssl.KeyManagerFactory; | ||||||||||
| import org.threeten.bp.Duration; | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * InstantiatingGrpcChannelProvider is a TransportChannelProvider which constructs a gRPC | ||||||||||
|
|
@@ -106,8 +109,8 @@ public final class InstantiatingGrpcChannelProvider implements TransportChannelP | |||||||||
| @Nullable private final GrpcInterceptorProvider interceptorProvider; | ||||||||||
| @Nullable private final Integer maxInboundMessageSize; | ||||||||||
| @Nullable private final Integer maxInboundMetadataSize; | ||||||||||
| @Nullable private final Duration keepAliveTime; | ||||||||||
| @Nullable private final Duration keepAliveTimeout; | ||||||||||
| @Nullable private final java.time.Duration keepAliveTime; | ||||||||||
| @Nullable private final java.time.Duration keepAliveTimeout; | ||||||||||
| @Nullable private final Boolean keepAliveWithoutCalls; | ||||||||||
| private final ChannelPoolSettings channelPoolSettings; | ||||||||||
| @Nullable private final Credentials credentials; | ||||||||||
|
|
@@ -490,13 +493,25 @@ public String getEndpoint() { | |||||||||
| return endpoint; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** This method is obsolete. Use {@link #getKeepAliveTimeDuration()} instead. */ | ||||||||||
| @ObsoleteApi("Use getKeepAliveTimeDuration() instead") | ||||||||||
| public org.threeten.bp.Duration getKeepAliveTime() { | ||||||||||
| return toThreetenDuration(getKeepAliveTimeDuration()); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** The time without read activity before sending a keepalive ping. */ | ||||||||||
| public Duration getKeepAliveTime() { | ||||||||||
| public java.time.Duration getKeepAliveTimeDuration() { | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like a breaking change. Have we released with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @burkedavison we keep the method signature in Lines 440 to 443 in 7774eb0
It is not a breaking change in terms of signature, but the implementation of the |
||||||||||
| return keepAliveTime; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** This method is obsolete. Use {@link #getKeepAliveTimeoutDuration()} instead */ | ||||||||||
| @ObsoleteApi("Use getKeepAliveTimeoutDuration() instead") | ||||||||||
|
diegomarquezp marked this conversation as resolved.
|
||||||||||
| public org.threeten.bp.Duration getKeepAliveTimeout() { | ||||||||||
| return toThreetenDuration(getKeepAliveTimeoutDuration()); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** The time without read activity after sending a keepalive ping. */ | ||||||||||
| public Duration getKeepAliveTimeout() { | ||||||||||
| public java.time.Duration getKeepAliveTimeoutDuration() { | ||||||||||
| return keepAliveTimeout; | ||||||||||
| } | ||||||||||
|
|
||||||||||
|
|
@@ -540,8 +555,8 @@ public static final class Builder { | |||||||||
| @Nullable private GrpcInterceptorProvider interceptorProvider; | ||||||||||
| @Nullable private Integer maxInboundMessageSize; | ||||||||||
| @Nullable private Integer maxInboundMetadataSize; | ||||||||||
| @Nullable private Duration keepAliveTime; | ||||||||||
| @Nullable private Duration keepAliveTimeout; | ||||||||||
| @Nullable private java.time.Duration keepAliveTime; | ||||||||||
| @Nullable private java.time.Duration keepAliveTimeout; | ||||||||||
| @Nullable private Boolean keepAliveWithoutCalls; | ||||||||||
| @Nullable private ApiFunction<ManagedChannelBuilder, ManagedChannelBuilder> channelConfigurator; | ||||||||||
| @Nullable private Credentials credentials; | ||||||||||
|
|
@@ -679,25 +694,53 @@ public Integer getMaxInboundMetadataSize() { | |||||||||
| return maxInboundMetadataSize; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * This method is obsolete. Use {@link #setKeepAliveTimeDuration(java.time.Duration)} instead. | ||||||||||
| */ | ||||||||||
| @ObsoleteApi("Use setKeepAliveTimeDuration(java.time.Duration) instead") | ||||||||||
| public Builder setKeepAliveTime(org.threeten.bp.Duration duration) { | ||||||||||
| return setKeepAliveTimeDuration(toJavaTimeDuration(duration)); | ||||||||||
| } | ||||||||||
| /** The time without read activity before sending a keepalive ping. */ | ||||||||||
| public Builder setKeepAliveTime(Duration duration) { | ||||||||||
| public Builder setKeepAliveTimeDuration(java.time.Duration duration) { | ||||||||||
| this.keepAliveTime = duration; | ||||||||||
| return this; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** This method is obsolete. Use {@link #getKeepAliveTimeDuration()} instead. */ | ||||||||||
| @ObsoleteApi("Use getKeepAliveTimeDuration() instead") | ||||||||||
| public org.threeten.bp.Duration getKeepAliveTime() { | ||||||||||
| return toThreetenDuration(getKeepAliveTimeDuration()); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** The time without read activity before sending a keepalive ping. */ | ||||||||||
| public Duration getKeepAliveTime() { | ||||||||||
| public java.time.Duration getKeepAliveTimeDuration() { | ||||||||||
| return keepAliveTime; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * This method is obsolete. Use {@link #setKeepAliveTimeoutDuration(java.time.Duration)} | ||||||||||
| * instead. | ||||||||||
| */ | ||||||||||
| @ObsoleteApi("Use setKeepAliveTimeoutDuration(java.time.Duration) instead") | ||||||||||
| public Builder setKeepAliveTimeout(org.threeten.bp.Duration duration) { | ||||||||||
| return setKeepAliveTimeoutDuration(toJavaTimeDuration(duration)); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** The time without read activity after sending a keepalive ping. */ | ||||||||||
| public Builder setKeepAliveTimeout(Duration duration) { | ||||||||||
| public Builder setKeepAliveTimeoutDuration(java.time.Duration duration) { | ||||||||||
| this.keepAliveTimeout = duration; | ||||||||||
| return this; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** This method is obsolete. Use {@link #getKeepAliveTimeoutDuration()} instead */ | ||||||||||
| @ObsoleteApi("Use getKeepAliveTimeoutDuration() instead") | ||||||||||
| public org.threeten.bp.Duration getKeepAliveTimeout() { | ||||||||||
| return toThreetenDuration(getKeepAliveTimeoutDuration()); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** The time without read activity after sending a keepalive ping. */ | ||||||||||
| public Duration getKeepAliveTimeout() { | ||||||||||
| public java.time.Duration getKeepAliveTimeoutDuration() { | ||||||||||
| return keepAliveTimeout; | ||||||||||
| } | ||||||||||
|
|
||||||||||
|
|
||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.