From 7a819beb46ba8159a5ad1e1a8e0a4aa702deb7f4 Mon Sep 17 00:00:00 2001 From: Zoe Wang <33073555+zoewangg@users.noreply.github.com> Date: Fri, 17 Feb 2023 12:01:57 -0800 Subject: [PATCH 1/3] Improve Javadoc for request-level timeout --- .../amazon/awssdk/core/RequestOverrideConfiguration.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java index abb425c5f7ec..d1c43fefb49e 100644 --- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java +++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java @@ -27,6 +27,7 @@ import java.util.function.Consumer; import software.amazon.awssdk.annotations.Immutable; import software.amazon.awssdk.annotations.SdkPublicApi; +import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; import software.amazon.awssdk.core.interceptor.ExecutionAttribute; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.core.signer.Signer; @@ -101,6 +102,9 @@ public List apiNames() { *

This may be used together with {@link #apiCallAttemptTimeout()} to enforce both a timeout on each individual HTTP * request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time). * + *

+ * This will override the {@link ClientOverrideConfiguration#apiCallTimeout()} if it is configured. + * * @see Builder#apiCallTimeout(Duration) */ public Optional apiCallTimeout() { @@ -120,6 +124,9 @@ public Optional apiCallTimeout() { * request * (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time). * + *

+ * This will override the {@link ClientOverrideConfiguration#apiCallAttemptTimeout()} if it is configured. + * * @see Builder#apiCallAttemptTimeout(Duration) */ public Optional apiCallAttemptTimeout() { From 52fd24369d22a7e2437a7f1dc7eded8c09939590 Mon Sep 17 00:00:00 2001 From: Zoe Wang <33073555+zoewangg@users.noreply.github.com> Date: Fri, 17 Feb 2023 15:26:02 -0800 Subject: [PATCH 2/3] Update docs --- .../awssdk/core/RequestOverrideConfiguration.java | 14 ++++++++------ .../client/config/ClientOverrideConfiguration.java | 9 +++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java index d1c43fefb49e..1dd67b4a6ceb 100644 --- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java +++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/RequestOverrideConfiguration.java @@ -102,9 +102,6 @@ public List apiNames() { *

This may be used together with {@link #apiCallAttemptTimeout()} to enforce both a timeout on each individual HTTP * request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time). * - *

- * This will override the {@link ClientOverrideConfiguration#apiCallTimeout()} if it is configured. - * * @see Builder#apiCallTimeout(Duration) */ public Optional apiCallTimeout() { @@ -124,9 +121,6 @@ public Optional apiCallTimeout() { * request * (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time). * - *

- * This will override the {@link ClientOverrideConfiguration#apiCallAttemptTimeout()} if it is configured. - * * @see Builder#apiCallAttemptTimeout(Duration) */ public Optional apiCallAttemptTimeout() { @@ -340,6 +334,10 @@ default B putRawQueryParameter(String name, String value) { *

This may be used together with {@link #apiCallAttemptTimeout()} to enforce both a timeout on each individual HTTP * request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time). * + *

+ * Note that this timeout takes precedence over the value configured at client level via + * {@link ClientOverrideConfiguration.Builder#apiCallTimeout(Duration)}. + * * @see RequestOverrideConfiguration#apiCallTimeout() */ B apiCallTimeout(Duration apiCallTimeout); @@ -358,6 +356,10 @@ default B putRawQueryParameter(String name, String value) { *

This may be used together with {@link #apiCallTimeout()} to enforce both a timeout on each individual HTTP * request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time). * + *

+ * Note that this timeout takes precedence over the value configured at client level via + * {@link ClientOverrideConfiguration.Builder#apiCallAttemptTimeout(Duration)}. + * * @see RequestOverrideConfiguration#apiCallAttemptTimeout() */ B apiCallAttemptTimeout(Duration apiCallAttemptTimeout); diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java index 07a2ee70725f..2be4627aa9c3 100644 --- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java +++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java @@ -26,6 +26,7 @@ import java.util.function.Consumer; import software.amazon.awssdk.annotations.SdkPublicApi; import software.amazon.awssdk.annotations.ToBuilderIgnoreField; +import software.amazon.awssdk.core.RequestOverrideConfiguration; import software.amazon.awssdk.core.interceptor.ExecutionAttribute; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; @@ -372,6 +373,9 @@ default Builder retryPolicy(RetryMode retryMode) { *

This may be used together with {@link #apiCallAttemptTimeout()} to enforce both a timeout on each individual HTTP * request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time). * + *

+ * You can also configure it on a per-request basis via {@link RequestOverrideConfiguration.Builder#apiCallTimeout(Duration)}. + * Note that request-level timeout takes precedence. * * @see ClientOverrideConfiguration#apiCallTimeout() */ @@ -394,6 +398,11 @@ default Builder retryPolicy(RetryMode retryMode) { *

This may be used together with {@link #apiCallTimeout()} to enforce both a timeout on each individual HTTP * request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time). * + *

+ * You can also configure it on a per-request basis via + * {@link RequestOverrideConfiguration.Builder#apiCallAttemptTimeout(Duration)}. + * Note that request-level timeout takes precedence. + * * @see ClientOverrideConfiguration#apiCallAttemptTimeout() */ Builder apiCallAttemptTimeout(Duration apiCallAttemptTimeout); From 976b155bb0b60ae59bdea72becb3bfa603075ebf Mon Sep 17 00:00:00 2001 From: Zoe Wang <33073555+zoewangg@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:57:11 -0800 Subject: [PATCH 3/3] Fix checkstyle --- .../awssdk/core/client/config/ClientOverrideConfiguration.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java index 2be4627aa9c3..4ba034413b90 100644 --- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java +++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java @@ -374,7 +374,8 @@ default Builder retryPolicy(RetryMode retryMode) { * request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time). * *

- * You can also configure it on a per-request basis via {@link RequestOverrideConfiguration.Builder#apiCallTimeout(Duration)}. + * You can also configure it on a per-request basis via + * {@link RequestOverrideConfiguration.Builder#apiCallTimeout(Duration)}. * Note that request-level timeout takes precedence. * * @see ClientOverrideConfiguration#apiCallTimeout()