-
Notifications
You must be signed in to change notification settings - Fork 863
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
Pause/Resume Upload for Transfer Manager with Java S3Client #4886
Pause/Resume Upload for Transfer Manager with Java S3Client #4886
Conversation
…atalog Settings. Introduce SASL/PLAIN as an authentication method for Glue Kafka connections
…edf75047e Pull request: release <- staging/96e1b8b2-3a37-418d-b480-f27edf75047e
This is a reintroduction of the reverted commit #4867. This includes a fix to the issue that caused the revert: improper handling of empty header values.
resumedUpload.completionFuture().join(); | ||
verifyMultipartUploadIdNotExist(resumableFileUpload); | ||
assertThat(resumedUpload.progress().snapshot().totalBytes()).hasValue(bytes.length); | ||
|
||
Files.write(largeFile.toPath(), originalBytes); |
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.
Unintentional change?
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.
we need to write back the original largeFile , since we overwrote it with "helloworld" to test file changed,
we are doing parameterized tests so this will run twice, one for each type of TM
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.
Should we do it in afterEach?
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.
we only overwrite it in this test, so dont need to write back for other tests
...ager/src/main/java/software/amazon/awssdk/transfer/s3/internal/GenericS3TransferManager.java
Outdated
Show resolved
Hide resolved
...ager/src/main/java/software/amazon/awssdk/transfer/s3/internal/GenericS3TransferManager.java
Outdated
Show resolved
Hide resolved
...m/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/model/FileUpload.java
Show resolved
Hide resolved
.../s3/src/main/java/software/amazon/awssdk/services/s3/internal/multipart/PauseObservable.java
Outdated
Show resolved
Hide resolved
...oftware/amazon/awssdk/services/s3/internal/multipart/UploadWithKnownContentLengthHelper.java
Outdated
Show resolved
Hide resolved
...oftware/amazon/awssdk/services/s3/internal/multipart/UploadWithKnownContentLengthHelper.java
Outdated
Show resolved
Hide resolved
...oftware/amazon/awssdk/services/s3/internal/multipart/UploadWithKnownContentLengthHelper.java
Outdated
Show resolved
Hide resolved
...oftware/amazon/awssdk/services/s3/internal/multipart/UploadWithKnownContentLengthHelper.java
Outdated
Show resolved
Hide resolved
...oftware/amazon/awssdk/services/s3/internal/multipart/UploadWithKnownContentLengthHelper.java
Show resolved
Hide resolved
* including S3 Access Grants Plugin as part of Java SDK Bundle --------- Co-authored-by: Shiva Kumar Mukkapati <[email protected]>
- .json files files for each version are grouped under minor versions in .changes - Markdown files for each minor version are created in changelogs/ directory - Changelog scripts updated to add a link to older version in the generated changelog
…only update to address customer issues.
…or use with your CAPTCHA JavaScript integration API.
…to the customers on the changes that they make on the domain.
…pArn, to the response of the logs:DescribeLogGroups action.
…ty to the customers on the changes that they make on the domain.
…c59dc86fd Pull request: release <- staging/6f43c303-a28b-4966-b004-d38c59dc86fd
resumedUpload.completionFuture().join(); | ||
verifyMultipartUploadIdNotExist(resumableFileUpload); | ||
assertThat(resumedUpload.progress().snapshot().totalBytes()).hasValue(bytes.length); | ||
|
||
Files.write(largeFile.toPath(), originalBytes); |
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.
Should we do it in afterEach?
...ager/src/main/java/software/amazon/awssdk/transfer/s3/internal/GenericS3TransferManager.java
Show resolved
Hide resolved
...ager/src/main/java/software/amazon/awssdk/transfer/s3/internal/GenericS3TransferManager.java
Outdated
Show resolved
Hide resolved
...manager/src/main/java/software/amazon/awssdk/transfer/s3/internal/TransferManagerHelper.java
Outdated
Show resolved
Hide resolved
.uploadId(uploadId) | ||
.bucket(putObjectRequest.bucket()) | ||
.key(putObjectRequest.key()) | ||
.partNumberMarker(0) |
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.
Is there any other parameter we should pass? Should we add a convert method?
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.
yup we need SSE-C fields, added conversion method to setAllFields
...oftware/amazon/awssdk/services/s3/internal/multipart/UploadWithKnownContentLengthHelper.java
Outdated
Show resolved
Hide resolved
.build(); | ||
ListPartsPublisher listPartsPublisher = s3AsyncClient.listPartsPaginator(request); | ||
SdkPublisher<Part> partsPublisher = listPartsPublisher.parts(); | ||
partsPublisher.subscribe(part -> existingParts.put(part.partNumber(), SdkPojoConversionUtils.toCompletedPart(part))); |
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.
How can we guarantee this gets finished before uploadParts?
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.
passing future and calling join() in Subscriber :: onNext()
@SdkInternalApi | ||
public class PauseObservable { | ||
|
||
private volatile UploadWithKnownContentLengthHelper.KnownContentLengthAsyncRequestBodySubscriber subscriber; |
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.
To avoid exposing internal class and implementation detail, suggesting creating another layer of abstraction like this: hdavidh/pause-resume-upload-java...zoewang/PR4886-review
...es/s3/src/main/java/software/amazon/awssdk/services/s3/internal/multipart/S3ResumeToken.java
Outdated
Show resolved
Hide resolved
...oftware/amazon/awssdk/services/s3/internal/multipart/UploadWithKnownContentLengthHelper.java
Outdated
Show resolved
Hide resolved
...oftware/amazon/awssdk/services/s3/internal/multipart/UploadWithKnownContentLengthHelper.java
Outdated
Show resolved
Hide resolved
…ng files or objects to transfer.
…ft Advisor recommendations.
…t replication feature as part of Lex Global Resiliency offering. This feature leverages a new set of APIs that allow customers to create bot replicas and replicate changes to bots across regions.
…2798c8cb1 Pull request: release <- staging/1c0c8ade-7bcb-4158-8160-4962798c8cb1
...3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3IntegrationTestBase.java
Outdated
Show resolved
Hide resolved
...fer-manager/src/main/java/software/amazon/awssdk/transfer/s3/internal/PauseResumeHelper.java
Show resolved
Hide resolved
...s/s3/src/main/java/software/amazon/awssdk/services/s3/internal/multipart/PausibleUpload.java
Outdated
Show resolved
Hide resolved
...ager/src/main/java/software/amazon/awssdk/transfer/s3/internal/GenericS3TransferManager.java
Show resolved
Hide resolved
… Chart Color Configuration; Documentation Update
…rallel & queued execution modes and add support for triggers with filtering on branches and file paths.
…ture. This feature allows Workspaces Core customers to provision workspaces without providing users. CreateWorkspaces and DescribeWorkspaces APIs will now take a new optional parameter "WorkspaceName".
…9f93cd5d9 Pull request: release <- staging/e358ef45-7969-4222-a98d-7fc9f93cd5d9
* Configure modeled signer properties for endpoint based auth scheme resolver * Refactor the logic to use Knowledge Indexes
* AWS Glue Update: Introduce Catalog Encryption Role within Glue Data Catalog Settings. Introduce SASL/PLAIN as an authentication method for Glue Kafka connections * Amazon WorkSpaces Update: Added definitions of various WorkSpace states * Release 2.23.18. Updated CHANGELOG.md, README.md and all pom.xml. * update aws-sdk-java pom to add imds and dyanmodb-enhanced (#4890) * Performance improvement for sigv4 signing. (#4891) This is a reintroduction of the reverted commit #4867. This includes a fix to the issue that caused the revert: improper handling of empty header values. * Update to next snapshot version: 2.23.19-SNAPSHOT * Delete CloudSearchv2IntegrationTest (#4888) * Fix tag deletion command (#4892) * including S3 Access Grants Plugin as part of Java SDK Bundle (#4881) * including S3 Access Grants Plugin as part of Java SDK Bundle --------- * Archive old changelog entries (< 2.23.0) (#4873) - .json files files for each version are grouped under minor versions in .changes - Markdown files for each minor version are created in changelogs/ directory - Changelog scripts updated to add a link to older version in the generated changelog * Changing indentation of config files to 4 spaces (#4889) * Amazon EC2 Container Service Update: This release is a documentation only update to address customer issues. * AWS WAFV2 Update: You can now delete an API key that you've created for use with your CAPTCHA JavaScript integration API. * Amazon OpenSearch Service Update: This release adds clear visibility to the customers on the changes that they make on the domain. * AWS AppSync Update: Support for environment variables in AppSync GraphQL APIs * Amazon CloudWatch Logs Update: This release adds a new field, logGroupArn, to the response of the logs:DescribeLogGroups action. * Amazon Elasticsearch Service Update: This release adds clear visibility to the customers on the changes that they make on the domain. * Release 2.23.19. Updated CHANGELOG.md, README.md and all pom.xml. * Update to next snapshot version: 2.23.20-SNAPSHOT * Bump CRT version and expose setting memory limits for S3 calls (#4885) * Bump aws-crt version to 0.29.9 * Exposes a setting to set the memory limit when making asynchronous calls with the CRT-based S3 client * Activating SRA for this service (#4896) * Fix request cancellation logic in the AWS CRT Sync HTTP client (#4887) * Fix request cancellation logic in the AWS CRT Sync HTTP client * Address feedback * Fix bug to allow MpuS3Client to PUT COPY with SSE-C and Checksum * Enable CRC32 for Multipart PUT COPY * Address comments * add changelog and update checksum check * Address comments * update javadocs * Add unit tests --------- Co-authored-by: AWS <> Co-authored-by: aws-sdk-java-automation <[email protected]> Co-authored-by: Zoe Wang <[email protected]> Co-authored-by: Matthew Miller <[email protected]> Co-authored-by: John Viegas <[email protected]> Co-authored-by: Dongie Agnir <[email protected]> Co-authored-by: shiva kumar <[email protected]> Co-authored-by: Shiva Kumar Mukkapati <[email protected]> Co-authored-by: Anna-Karin Salander <[email protected]>
* Fix bug to allow MpuS3Client to PUT COPY with SSE-C and Checksum * Enable CRC32 for Multipart PUT COPY * Address comments * add changelog and update checksum check * Address comments * update javadocs * Add unit tests
…pause-resume-upload-java
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
messy merges from other PR, closing in favor of new PR |
Motivation and Context
Currently pausing/resuming a file upload with TransferManager is only supported with CRT S3 Client.
Modifications
Adding support when using Java S3 Client
Testing
added integ tests
to add unit tests in separate PR
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License