Changes in Amazon S3 Transfer Manager from version 1 to version 2
This topic details the changes in the Amazon S3 Transfer Manager from version 1 (v1) to version 2 (v2).
High-level changes
Change | v1 | v2 |
---|---|---|
Maven dependencies |
|
|
Package name | com.amazonaws.services.s3.transfer |
software.amazon.awssdk.transfer.s3 |
Class name |
1
Latest
version
Configuration API changes
Setting | v1 | v2 |
---|---|---|
(get a builder) |
|
|
S3 client |
|
|
Executor |
|
|
Shutdown thread pools |
|
Not supported. The provided executor will not be shut down when the S3TransferManager is closed |
Minimum upload part size |
|
|
Multipart upload threshold |
|
|
Minimum copy part size |
|
|
Multipart copy threshold |
|
|
Disable parallel downloads |
|
Disable parallel downloads by passing a standard Java-based S3 client to
the transfer
manager.
|
Always calculate multipart md5 |
|
Not supported. |
Behavior changes
Parallel transfer requires Amazon CRT-based S3 client
In the SDK for Java 2.x, the automatic parallel transfer feature (multipart upload/download)
is available through the Amazon CRT-based S3 client
The Amazon CRT-based S3 client alone—without using
S3TransferManager
—provides maximized performance of parallel
transfers. S3TransferManager
v2 provides additional APIs that make it
easier to transfer files and directories.
The ability for the S3TransferManager
to perform parallel transfers
depends on the how S3TransferManager
is initiated and if the Amazon Common
Runtime (CRT) library has been declared as a dependency.
The following table describes three initialization scenarios for an
S3TransferManager
v2 with and without the Amazon CRT declared as a
dependency.
S3TransferManager v2 initialization approach | Is Amazon CRT declared as a dependency? | |
---|---|---|
yes | no | |
Initialize the Static create method:
- OR - Builder method:
|
automatic parallel transfer enabled |
automatic parallel transfer disabled |
Pass an
- OR -
|
automatic parallel transfer enabled |
runtime error |
Pass an
- OR -
|
automatic parallel transfer disabled |
automatic parallel transfer disabled |
Parallel download via byte-range fetches
When the automatic parallel transfer feature is enabled, the S3 Transfer Manager v2 uses byte-range fetches to retrieve specific portions of the object in parallel (multipart download). The way an object is downloaded with v2 does not depend on how the object was originally uploaded. All downloads can benefit from high throughput and concurrency.
In contrast, with S3 Transfer Manager v1, it does matter how the object was originally uploaded. The S3 Transfer Manager v1 retrieves the parts of the object the same way that the parts were uploaded. If an object was originally uploaded as a single object, the S3 Transfer Manager v1 is not able to accelerate the downloading process by using sub-requests.
Failure behavior
With S3 Transfer Manager v1, a directory transfer request fails if any sub-request fails. Unlike v1, the future returned from S3 Transfer Manager v2 completes successfully even if some sub-requests fail.
As a result, you should check for errors in the response by using the CompletedDirectoryDownload.failedTransfers()
CompletedDirectoryUpload.failedTransfers()