|
31 | 31 | import java.nio.file.Path; |
32 | 32 | import java.util.ArrayList; |
33 | 33 | import java.util.List; |
| 34 | +import java.util.Map; |
34 | 35 | import java.util.concurrent.CompletableFuture; |
35 | 36 | import java.util.concurrent.Executor; |
36 | 37 | import software.amazon.awssdk.annotations.SdkInternalApi; |
|
47 | 48 | import software.amazon.awssdk.core.checksums.RequestChecksumCalculation; |
48 | 49 | import software.amazon.awssdk.core.checksums.ResponseChecksumValidation; |
49 | 50 | import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; |
| 51 | +import software.amazon.awssdk.core.client.config.SdkAdvancedAsyncClientOption; |
50 | 52 | import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption; |
51 | 53 | import software.amazon.awssdk.core.interceptor.Context; |
52 | 54 | import software.amazon.awssdk.core.interceptor.ExecutionAttribute; |
|
78 | 80 | import software.amazon.awssdk.services.s3.model.GetObjectResponse; |
79 | 81 | import software.amazon.awssdk.services.s3.model.PutObjectRequest; |
80 | 82 | import software.amazon.awssdk.services.s3.model.PutObjectResponse; |
| 83 | +import software.amazon.awssdk.utils.AttributeMap; |
81 | 84 | import software.amazon.awssdk.utils.CollectionUtils; |
82 | 85 | import software.amazon.awssdk.utils.Validate; |
83 | 86 |
|
@@ -222,7 +225,8 @@ private static S3CrtAsyncHttpClient.Builder initializeS3CrtAsyncHttpClient(Defau |
222 | 225 | .readBufferSizeInBytes(builder.readBufferSizeInBytes) |
223 | 226 | .httpConfiguration(builder.httpConfiguration) |
224 | 227 | .thresholdInBytes(builder.thresholdInBytes) |
225 | | - .maxNativeMemoryLimitInBytes(builder.maxNativeMemoryLimitInBytes); |
| 228 | + .maxNativeMemoryLimitInBytes(builder.maxNativeMemoryLimitInBytes) |
| 229 | + .advancedOptions(builder.advancedOptions.build()); |
226 | 230 |
|
227 | 231 | if (builder.retryConfiguration != null) { |
228 | 232 | nativeClientBuilder.standardRetryOptions( |
@@ -257,6 +261,7 @@ public static final class DefaultS3CrtClientBuilder implements S3CrtAsyncClientB |
257 | 261 | private Executor futureCompletionExecutor; |
258 | 262 | private Boolean disableS3ExpressSessionAuth; |
259 | 263 |
|
| 264 | + private AttributeMap.Builder advancedOptions = AttributeMap.builder(); |
260 | 265 |
|
261 | 266 | @Override |
262 | 267 | public DefaultS3CrtClientBuilder credentialsProvider(AwsCredentialsProvider credentialsProvider) { |
@@ -388,6 +393,18 @@ public DefaultS3CrtClientBuilder disableS3ExpressSessionAuth(Boolean disableS3Ex |
388 | 393 | return this; |
389 | 394 | } |
390 | 395 |
|
| 396 | + @Override |
| 397 | + public <T> DefaultS3CrtClientBuilder advancedOption(SdkAdvancedAsyncClientOption<T> option, T value) { |
| 398 | + this.advancedOptions.put(option, value); |
| 399 | + return this; |
| 400 | + } |
| 401 | + |
| 402 | + @Override |
| 403 | + public DefaultS3CrtClientBuilder advancedOptions(Map<SdkAdvancedAsyncClientOption<?>, ?> advancedOptions) { |
| 404 | + this.advancedOptions.putAll(advancedOptions); |
| 405 | + return this; |
| 406 | + } |
| 407 | + |
391 | 408 | @Override |
392 | 409 | public S3CrtAsyncClient build() { |
393 | 410 | return new DefaultS3CrtAsyncClient(this); |
|
0 commit comments