Skip to content

Commit 4a924a8

Browse files
committed
Update Javadocs
1 parent fd966ad commit 4a924a8

17 files changed

+188
-81
lines changed

services-custom/s3-transfer-manager/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You can instantiate the transfer manager easily using the default settings
2626

2727
```java
2828

29-
S3TranfserManager tranferManager = S3TransferManager.create();
29+
S3TransferManager transferManager = S3TransferManager.create();
3030

3131
```
3232

services-custom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/CompletedDownload.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@
1515

1616
package software.amazon.awssdk.transfer.s3;
1717

18+
import software.amazon.awssdk.annotations.SdkPreviewApi;
1819
import software.amazon.awssdk.annotations.SdkPublicApi;
1920
import software.amazon.awssdk.services.s3.model.GetObjectResponse;
20-
import software.amazon.awssdk.transfer.s3.internal.S3CrtAsyncClient;
2121

2222
/**
2323
* A completed download transfer.
2424
*/
2525
@SdkPublicApi
26+
@SdkPreviewApi
2627
public interface CompletedDownload extends CompletedTransfer {
2728

2829
/**
29-
* Returns the API response from the {@link S3CrtAsyncClient#getObject}
30+
* Returns the API response from the {@link S3TransferManager#download(DownloadRequest)}
3031
* @return the response
3132
*/
3233
GetObjectResponse response();

services-custom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/CompletedDownloadDirectory.java

Lines changed: 0 additions & 25 deletions
This file was deleted.

services-custom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/CompletedTransfer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515

1616
package software.amazon.awssdk.transfer.s3;
1717

18+
import software.amazon.awssdk.annotations.SdkPreviewApi;
1819
import software.amazon.awssdk.annotations.SdkPublicApi;
1920

2021
/**
2122
* A completed transfer.
2223
*/
2324
@SdkPublicApi
25+
@SdkPreviewApi
2426
public interface CompletedTransfer {
2527
}

services-custom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/CompletedUpload.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,20 @@
1515

1616
package software.amazon.awssdk.transfer.s3;
1717

18+
import software.amazon.awssdk.annotations.SdkPreviewApi;
1819
import software.amazon.awssdk.annotations.SdkPublicApi;
1920
import software.amazon.awssdk.services.s3.model.PutObjectResponse;
20-
import software.amazon.awssdk.transfer.s3.internal.DefaultCompletedUpload;
2121

2222
/**
2323
* A completed upload transfer.
2424
*/
2525
@SdkPublicApi
26+
@SdkPreviewApi
2627
public interface CompletedUpload extends CompletedTransfer {
27-
PutObjectResponse response();
28-
29-
static Builder builder() {
30-
return new DefaultCompletedUpload.BuilderImpl();
31-
}
3228

33-
interface Builder {
34-
Builder response(PutObjectResponse response);
35-
36-
CompletedUpload build();
37-
}
29+
/**
30+
* Returns the API response from the {@link S3TransferManager#upload(UploadRequest)}
31+
* @return the response
32+
*/
33+
PutObjectResponse response();
3834
}

services-custom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/Download.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616
package software.amazon.awssdk.transfer.s3;
1717

1818
import java.util.concurrent.CompletableFuture;
19+
import software.amazon.awssdk.annotations.SdkPreviewApi;
1920
import software.amazon.awssdk.annotations.SdkPublicApi;
2021

2122
/**
2223
* A download transfer of a single object from S3.
2324
*/
2425
@SdkPublicApi
26+
@SdkPreviewApi
2527
public interface Download extends Transfer {
28+
2629
@Override
2730
CompletableFuture<CompletedDownload> completionFuture();
2831
}

services-custom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/DownloadRequest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.Objects;
2020
import java.util.function.Consumer;
2121
import software.amazon.awssdk.annotations.NotThreadSafe;
22+
import software.amazon.awssdk.annotations.SdkPreviewApi;
2223
import software.amazon.awssdk.annotations.SdkPublicApi;
2324
import software.amazon.awssdk.services.s3.model.GetObjectRequest;
2425
import software.amazon.awssdk.utils.Validate;
@@ -29,6 +30,7 @@
2930
* Request object to download an object from S3 using the Transfer Manager.
3031
*/
3132
@SdkPublicApi
33+
@SdkPreviewApi
3234
public final class DownloadRequest implements TransferRequest, ToCopyableBuilder<DownloadRequest.Builder, DownloadRequest> {
3335
private final Path destination;
3436
private final GetObjectRequest getObjectRequest;
@@ -115,14 +117,20 @@ public interface Builder extends TransferRequest.Builder<DownloadRequest, Builde
115117
*
116118
* @param getObjectRequest the getObject request
117119
* @return a reference to this object so that method calls can be chained together.
120+
* @see #getObjectRequest(Consumer)
118121
*/
119122
Builder getObjectRequest(GetObjectRequest getObjectRequest);
120123

121124
/**
122125
* The {@link GetObjectRequest} request that should be used for the download
123126
*
127+
* <p>
128+
* This is a convenience method that creates an instance of the {@link GetObjectRequest} builder avoiding the
129+
* need to create one manually via {@link GetObjectRequest#builder()}.
130+
*
124131
* @param getObjectRequestBuilder the getObject request
125132
* @return a reference to this object so that method calls can be chained together.
133+
* @see #getObjectRequest(GetObjectRequest)
126134
*/
127135
default Builder getObjectRequest(Consumer<GetObjectRequest.Builder> getObjectRequestBuilder) {
128136
GetObjectRequest request = GetObjectRequest.builder()
@@ -132,7 +140,6 @@ default Builder getObjectRequest(Consumer<GetObjectRequest.Builder> getObjectReq
132140
return this;
133141
}
134142

135-
136143
/**
137144
* @return The built request.
138145
*/

services-custom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/S3ClientConfiguration.java

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
2727

2828
/**
29-
* Configuration values for which the TransferManager already provides sensible defaults. All values are optional
29+
* Optional Configurations for the underlying S3 client for which the TransferManager already provides
30+
* sensible defaults.
3031
*
3132
* <p>Use {@link #builder()} to create a set of options.</p>
3233
*/
@@ -124,15 +125,35 @@ public int hashCode() {
124125
return result;
125126
}
126127

128+
/**
129+
* Creates a default builder for {@link S3ClientConfiguration}.
130+
*/
127131
public static Builder builder() {
128132
return new DefaultBuilder();
129133
}
130134

135+
/**
136+
* The builder definition for a {@link S3ClientConfiguration}.
137+
*/
131138
public interface Builder extends CopyableBuilder<Builder, S3ClientConfiguration> {
132139

133140
/**
134141
* Configure the credentials that should be used to authenticate with S3.
135142
*
143+
* <p>The default provider will attempt to identify the credentials automatically using the following checks:
144+
* <ol>
145+
* <li>Java System Properties - <code>aws.accessKeyId</code> and <code>aws.secretKey</code></li>
146+
* <li>Environment Variables - <code>AWS_ACCESS_KEY_ID</code> and <code>AWS_SECRET_ACCESS_KEY</code></li>
147+
* <li>Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI</li>
148+
* <li>Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
149+
* environment variable is set and security manager has permission to access the variable.</li>
150+
* <li>Instance profile credentials delivered through the Amazon EC2 metadata service</li>
151+
* </ol>
152+
*
153+
* <p>If the credentials are not found in any of the locations above, an exception will be thrown at {@link #build()}
154+
* time.
155+
* </p>
156+
*
136157
* @param credentialsProvider the credentials to use
137158
* @return This builder for method chaining.
138159
*/
@@ -169,21 +190,30 @@ public interface Builder extends CopyableBuilder<Builder, S3ClientConfiguration>
169190

170191
/**
171192
* The target throughput for transfer requests. Higher value means more S3 connections
172-
* will be opened.
193+
* will be opened. Whether the transfer manager can achieve the configured target throughput depends
194+
* on various factors such as the network bandwidth of the environment and the configured {@link #maxConcurrency}.
173195
*
174196
* <p>
175197
* By default, it is 5Gbps
176198
*
177199
* @param targetThroughputInGbps the target throughput in Gbps
178200
* @return this builder for method chaining.
201+
* @see #maxConcurrency(Integer)
179202
*/
180203
Builder targetThroughputInGbps(Double targetThroughputInGbps);
181204

182205
/**
183-
* Specifies the maximum number of concurrent Amazon S3 transfer requests that can run at the same time.
206+
* Specifies the maximum number of S3 connections that should be established during
207+
* a transfer.
208+
*
209+
* <p>
210+
* If not provided, the TransferManager will calculate the optional number of connections
211+
* based on {@link #targetThroughputInGbps}. If the value is too low, the S3TransferManager
212+
* might not achieve the specified target throughput.
184213
*
185214
* @param maxConcurrency the max number of concurrent requests
186215
* @return this builder for method chaining.
216+
* @see #targetThroughputInGbps(Double)
187217
*/
188218
Builder maxConcurrency(Integer maxConcurrency);
189219
}

0 commit comments

Comments
 (0)