-
Notifications
You must be signed in to change notification settings - Fork 916
S3 Multipart API implementation #4224
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
Changes from 250 commits
ef1e51b
751f50b
3982769
70ddf66
4d7a27c
8aa76b4
68795f5
f4c2167
ba40535
6ee2d0d
42abc9d
86aeb36
06c969a
406bc49
d9d8273
fd34dd0
4f0915a
6292bdd
2791572
1538652
65def41
560785f
a7e35d9
39d9202
c160777
2b541b8
45472bf
fcb0cf7
67ab557
cd765b6
82b54e3
fee6014
a0ee7f9
f2c093c
dd4752d
e6b8bcc
fd34311
825cde5
c5aca13
b11ecf5
ae5679e
1c1632a
ff36749
6b21cab
c0285b2
d7655f6
3239ac7
4483584
0e6fff9
51b70de
5d9e0ba
fe36755
2099272
4e90005
014a284
bd84f34
50a268f
c9f4c79
a298681
d83eb94
6de4b23
8a45afd
b726e3b
40c1f53
ad82d40
923742c
bbcd079
48808f5
c35be0c
42aa7f7
e8bff70
1da90fe
34331ea
c3083a4
ee2cd81
2b51968
2bc77e9
b15dc72
d211196
ffbf8c7
b399d48
e8d8a84
e357f22
119cad0
4088b52
65a7ba6
08b189f
28ed38d
b88b1c7
9164e65
12d227f
628c7f4
444e247
715e66c
be3568b
5e7b25b
c820131
a63829d
81d7929
7d95625
3aa71c2
52c48db
bcabecf
5db8c2d
df6b869
cbde865
4a4db06
ccded28
c2728a0
78e9a30
bb61412
4bea342
bef6237
e60e2a9
25e7855
e478163
8610e56
1addfea
e54a234
ec11a0e
5ba7741
39cf97e
4b6fcbc
11ab0f1
48fb07e
8cae98f
a00be8b
e3a0906
0bbaab4
923ead6
21d448b
cfa405e
a7ed664
699c1f1
a606809
8e2d29b
f768da8
32f03fd
19f8c6a
d01352d
5e1c05e
8930957
6344b9d
4d53a01
dff1144
a519b76
258b799
2eee25c
8fd0025
08f46ee
4b94050
39f14d4
a680087
bba2caa
fb9525a
30f9fd8
a53e6da
b1caf24
fdfbc8e
d2d4be7
bb3cf49
5d2f196
2fcee58
3ea4bc6
006250e
f8fd72c
4192716
f805c0a
0659904
668bf0b
d269b7e
971e49f
8da2e8f
7b8de20
cee3e3f
01f84a4
f192b8e
b0021b9
4fd79ee
dc1fd42
ad83769
6cc1f0f
ecf6f8f
37f3430
89f162f
489ac04
e3ff9d4
ecb1e58
f35bd17
6ea6238
3201653
382293d
966bff5
304f0b3
08d822a
888e085
81baee4
db1dd94
3c57585
4d7beb3
28c58e5
947f4ed
4a447cc
c7d4af6
a4a3953
05537e1
06e4329
7899fc3
8c8eb6e
6f78e3a
c281433
bfe150e
c7a4ec0
de537cf
9d3316e
56d58bb
14e809e
e1db768
9ec3b25
3828c47
f7b3920
f366f67
12fb225
ef35e00
9bcae5f
b55f279
a042cce
cd791a3
4730da8
6ceca78
7810596
54495c6
0031761
95bba3c
5bfe4a5
96b0b52
540841c
f586095
06a0713
b303583
1b49589
f5b50f7
9a83c9b
b8f68b9
42d1dda
2cf3a17
7f03028
13d1dd9
8bf7f10
9f8c427
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "feature", | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "StephenFlavin", | ||
"description": "Add \"unsafe\" and \"fromRemaining\" AsyncRequestBody constructors for byte arrays and ByteBuffers" | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "feature", | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "", | ||
"description": "Cross region bucket access for S3 Client. This feature will allow users to access buckets of different region using a single cross region configured client." | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,6 +227,18 @@ public class CustomizationConfig { | |
*/ | ||
private String asyncClientDecorator; | ||
|
||
/** | ||
* For S3AsyncClient only. Fully qualified name of the class to be used for multipart configuration | ||
*/ | ||
private String multipartConfigurationClass; | ||
|
||
/** | ||
* For S3AsyncClient only. Javadoc associated with the generated method on the S3AsyncClientBuilder interface for multipart | ||
* configuration. | ||
*/ | ||
private String multipartMethodJavadoc; | ||
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. What are the pros/cons of this compared to just using customClientContextParams or something similar? https://github.com/aws/aws-sdk-java-v2/blob/master/services/s3/src/main/resources/codegen-resources/customization.config#L255-L260 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. I tried that first, but a custom client context param also adds the method to the sync client builder, but we only want multipart for the async builder. Maybe I am unaware of a way to limit customClientContextParams to only only the sync/async interface? 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. Seems fine, since this is just an internal API. We can always refactor it later if we wanted to. E.g. make customClientContextParams have an async-only flag. |
||
|
||
|
||
/** | ||
* Whether to skip generating endpoint tests from endpoint-tests.json | ||
*/ | ||
|
@@ -665,4 +677,21 @@ public Map<String, ClientContextParam> getCustomClientContextParams() { | |
public void setCustomClientContextParams(Map<String, ClientContextParam> customClientContextParams) { | ||
this.customClientContextParams = customClientContextParams; | ||
} | ||
|
||
public String getMultipartConfigurationClass() { | ||
return this.multipartConfigurationClass; | ||
} | ||
|
||
public void setMultipartConfigurationClass(String multipartConfigurationClass) { | ||
this.multipartConfigurationClass = multipartConfigurationClass; | ||
} | ||
|
||
public String getMultipartMethodDoc() { | ||
return this.multipartMethodJavadoc; | ||
} | ||
|
||
public void setMultipartMethodDoc(String multipartMethodJavadoc) { | ||
this.multipartMethodJavadoc = multipartMethodJavadoc; | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.services.s3.multipart; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import software.amazon.awssdk.regions.Region; | ||
import software.amazon.awssdk.services.s3.S3AsyncClient; | ||
import software.amazon.awssdk.services.s3.internal.multipart.MultipartS3AsyncClient; | ||
|
||
class S3MultipartClientBuilderTest { | ||
|
||
@Test | ||
void builderWithMultipartConfig_shouldBuildMultipartClient() { | ||
S3AsyncClient client = S3AsyncClient.builder() | ||
.multipartConfiguration(MultipartConfiguration.builder().build()) | ||
.region(Region.US_EAST_1) | ||
.build(); | ||
assertThat(client).isInstanceOf(MultipartS3AsyncClient.class); | ||
|
||
} | ||
|
||
@Test | ||
void builderWithMultipartConfig_consumerBuilder_shouldBuildMultipartClient() { | ||
S3AsyncClient client = S3AsyncClient.builder() | ||
.multipartConfiguration(b -> b.multipartEnabled(true)) | ||
.region(Region.US_EAST_1) | ||
.build(); | ||
assertThat(client).isInstanceOf(MultipartS3AsyncClient.class); | ||
} | ||
|
||
@Test | ||
void builderWithMultipartConfig_disabled_shouldNotBuildMultipartClient() { | ||
S3AsyncClient client = S3AsyncClient.builder() | ||
.multipartConfiguration(b -> b.multipartEnabled(false)) | ||
.region(Region.US_EAST_1) | ||
.build(); | ||
assertThat(client).isNotInstanceOf(MultipartS3AsyncClient.class); | ||
} | ||
|
||
@Test | ||
void builderWithoutMultipartConfig_shouldNotBeMultipartClient() { | ||
S3AsyncClient client = S3AsyncClient.builder() | ||
.region(Region.US_EAST_1) | ||
.build(); | ||
assertThat(client).isNotInstanceOf(MultipartS3AsyncClient.class); | ||
} | ||
} |
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.
Why is this in this PR?
Uh oh!
There was an error while loading. Please reload this page.
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.
had to merge master branch to get ClientComposer/DelegateClient related classes