15
15
16
16
package software .amazon .awssdk .core .config ;
17
17
18
- import java .time .Duration ;
19
18
import java .util .ArrayList ;
20
19
import java .util .Collections ;
21
20
import java .util .HashMap ;
22
21
import java .util .List ;
23
22
import java .util .Map ;
24
23
import java .util .function .Consumer ;
25
- import software .amazon .awssdk .annotations .ReviewBeforeRelease ;
26
24
import software .amazon .awssdk .annotations .SdkInternalApi ;
27
25
import software .amazon .awssdk .core .interceptor .ExecutionInterceptor ;
28
26
import software .amazon .awssdk .core .retry .RetryPolicy ;
39
37
* <p>Use {@link #builder()} to create a set of options.</p>
40
38
*/
41
39
public class ClientOverrideConfiguration
42
- implements ToCopyableBuilder <ClientOverrideConfiguration .Builder , ClientOverrideConfiguration > {
43
- private final Duration httpRequestTimeout ;
44
- private final Duration totalExecutionTimeout ;
40
+ implements ToCopyableBuilder <ClientOverrideConfiguration .Builder , ClientOverrideConfiguration > {
45
41
private final Map <String , List <String >> additionalHttpHeaders ;
46
42
private final Boolean gzipEnabled ;
47
43
private final RetryPolicy retryPolicy ;
@@ -52,8 +48,6 @@ public class ClientOverrideConfiguration
52
48
* Initialize this configuration. Private to require use of {@link #builder()}.
53
49
*/
54
50
private ClientOverrideConfiguration (DefaultClientOverrideConfigurationBuilder builder ) {
55
- this .httpRequestTimeout = builder .httpRequestTimeout ;
56
- this .totalExecutionTimeout = builder .totalExecutionTimeout ;
57
51
this .additionalHttpHeaders = CollectionUtils .deepUnmodifiableMap (builder .additionalHttpHeaders );
58
52
this .gzipEnabled = builder .gzipEnabled ;
59
53
this .retryPolicy = builder .retryPolicy ;
@@ -64,8 +58,6 @@ private ClientOverrideConfiguration(DefaultClientOverrideConfigurationBuilder bu
64
58
@ Override
65
59
public Builder toBuilder () {
66
60
return new DefaultClientOverrideConfigurationBuilder ().advancedOptions (advancedOptions .toBuilder ())
67
- .httpRequestTimeout (httpRequestTimeout )
68
- .totalExecutionTimeout (totalExecutionTimeout )
69
61
.additionalHttpHeaders (additionalHttpHeaders )
70
62
.gzipEnabled (gzipEnabled )
71
63
.retryPolicy (retryPolicy )
@@ -79,49 +71,6 @@ public static Builder builder() {
79
71
return new DefaultClientOverrideConfigurationBuilder ();
80
72
}
81
73
82
- /**
83
- * The amount of time to wait for the request to complete before giving up and timing out. An empty value disables this
84
- * feature.
85
- *
86
- * <p>This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when
87
- * reading the response. For APIs that return large responses this could be expensive.</p>
88
- *
89
- * <p>The request timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is
90
- * breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't
91
- * get aborted until several seconds after the timer has been breached. Because of this, the request timeout feature should
92
- * not be used when absolute precision is needed.</p>
93
- *
94
- * @see Builder#httpRequestTimeout(Duration)
95
- */
96
- @ ReviewBeforeRelease ("This doesn't currently work." )
97
- public Duration httpRequestTimeout () {
98
- return httpRequestTimeout ;
99
- }
100
-
101
- /**
102
- * The amount of time to allow the client to complete the execution of an API call. This timeout covers the entire client
103
- * execution except for marshalling. This includes request handler execution, all HTTP requests including retries,
104
- * unmarshalling, etc. An empty value disables this feature.
105
- *
106
- * <p>This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when
107
- * reading the response. For APIs that return large responses this could be expensive.</p>
108
- *
109
- * <p>The client execution timeout feature doesn't have strict guarantees on how quickly a request is aborted when the
110
- * timeout
111
- * is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that
112
- * don't get aborted until several seconds after the timer has been breached. Because of this, the client execution timeout
113
- * feature should not be used when absolute precision is needed.</p>
114
- *
115
- * <p>This may be used together with {@link #httpRequestTimeout()} to enforce both a timeout on each individual HTTP request
116
- * (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'client execution' time). A
117
- * non-positive value disables this feature.</p>
118
- *
119
- * @see Builder#totalExecutionTimeout(Duration)
120
- */
121
- public Duration totalExecutionTimeout () {
122
- return totalExecutionTimeout ;
123
- }
124
-
125
74
/**
126
75
* An unmodifiable representation of the set of HTTP headers that should be sent with every request. If not set, this will
127
76
* return an empty map.
@@ -173,8 +122,6 @@ public List<ExecutionInterceptor> executionInterceptors() {
173
122
@ Override
174
123
public String toString () {
175
124
return ToString .builder ("ClientOverrideConfiguration" )
176
- .add ("httpRequestTimeout" , httpRequestTimeout )
177
- .add ("totalExecutionTimeout" , totalExecutionTimeout )
178
125
.add ("additionalHttpHeaders" , additionalHttpHeaders )
179
126
.add ("gzipEnabled" , gzipEnabled )
180
127
.add ("retryPolicy" , retryPolicy )
@@ -189,43 +136,6 @@ public String toString() {
189
136
* <p>All implementations of this interface are mutable and not thread safe.</p>
190
137
*/
191
138
public interface Builder extends CopyableBuilder <Builder , ClientOverrideConfiguration > {
192
- /**
193
- * Configure the amount of time to wait for the request to complete before giving up and timing out. A non-positive value
194
- * disables this feature.
195
- *
196
- * <p>This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout
197
- * when reading the response. For APIs that return large responses this could be expensive.</p>
198
- *
199
- * <p>The request timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is
200
- * breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that
201
- * don't get aborted until several seconds after the timer has been breached. Because of this, the request timeout
202
- * feature
203
- * should not be used when absolute precision is needed.</p>
204
- *
205
- * @see ClientOverrideConfiguration#httpRequestTimeout()
206
- */
207
- Builder httpRequestTimeout (Duration httpRequestTimeout );
208
-
209
- /**
210
- * Configure the amount of time to allow the client to complete the execution of an API call. This timeout covers the
211
- * entire client execution except for marshalling. This includes request handler execution, all HTTP request including
212
- * retries, unmarshalling, etc.
213
- *
214
- * <p>This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout
215
- * when reading the response. For APIs that return large responses this could be expensive.</p>
216
- *
217
- * <p>The client execution timeout feature doesn't have strict guarantees on how quickly a request is aborted when the
218
- * timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be
219
- * requests that don't get aborted until several seconds after the timer has been breached. Because of this, the client
220
- * execution timeout feature should not be used when absolute precision is needed.</p>
221
- *
222
- * <p>This may be used together with {@link #httpRequestTimeout()} to enforce both a timeout on each individual HTTP
223
- * request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'client execution' time).
224
- * A non-positive value disables this feature.</p>
225
- *
226
- * @see ClientOverrideConfiguration#totalExecutionTimeout()
227
- */
228
- Builder totalExecutionTimeout (Duration totalExecutionTimeout );
229
139
230
140
/**
231
141
* Define a set of headers that should be added to every HTTP request sent to AWS. This will override any headers
@@ -322,34 +232,12 @@ default Builder retryPolicy(Consumer<RetryPolicy.Builder> retryPolicy) {
322
232
* An SDK-internal implementation of {@link ClientOverrideConfiguration.Builder}.
323
233
*/
324
234
private static final class DefaultClientOverrideConfigurationBuilder implements Builder {
325
- private Duration httpRequestTimeout ;
326
- private Duration totalExecutionTimeout ;
327
235
private Map <String , List <String >> additionalHttpHeaders = new HashMap <>();
328
236
private Boolean gzipEnabled ;
329
237
private RetryPolicy retryPolicy ;
330
238
private List <ExecutionInterceptor > executionInterceptors = new ArrayList <>();
331
239
private AttributeMap .Builder advancedOptions = AttributeMap .builder ();
332
240
333
- @ Override
334
- public Builder httpRequestTimeout (Duration httpRequestTimeout ) {
335
- this .httpRequestTimeout = httpRequestTimeout ;
336
- return this ;
337
- }
338
-
339
- public void setHttpRequestTimeout (Duration httpRequestTimeout ) {
340
- httpRequestTimeout (httpRequestTimeout );
341
- }
342
-
343
- @ Override
344
- public Builder totalExecutionTimeout (Duration totalExecutionTimeout ) {
345
- this .totalExecutionTimeout = totalExecutionTimeout ;
346
- return this ;
347
- }
348
-
349
- public void setTotalExecutionTimeout (Duration totalExecutionTimeout ) {
350
- totalExecutionTimeout (totalExecutionTimeout );
351
- }
352
-
353
241
@ Override
354
242
public Builder additionalHttpHeaders (Map <String , List <String >> additionalHttpHeaders ) {
355
243
this .additionalHttpHeaders = CollectionUtils .deepCopyMap (additionalHttpHeaders );
0 commit comments