-
Notifications
You must be signed in to change notification settings - Fork 814
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
[TM DownloadFile Pause and Resume] Part 3: Implement resumeDownloadFile #3157
[TM DownloadFile Pause and Resume] Part 3: Implement resumeDownloadFile #3157
Conversation
e0a702c
to
4934726
Compare
public static FileTransformerConfiguration defaultCreateOrReplaceExisting() { | ||
return builder().fileWriteOption(FileWriteOption.CREATE_OR_REPLACE_EXISTING) | ||
.failureBehavior(FailureBehavior.DELETE) | ||
.failureBehavior(FailureBehavior.LEAVE) | ||
.build(); |
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 had to change the default behavior for createOrReplaceExisting because always deleting a file upon exceptions would not work for resume (manifested as cancellation exception)
Another option is to move this method defaultCreateOrReplaceExisting
along with defaultCreateOrAppend
to s3-transfer-manager` and make them private APIs if we think this behavior is confusing.
WDYT?
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.
No I think this behavior is fine
...tom/s3-transfer-manager/src/main/java/software/amazon/awssdk/transfer/s3/ObjectTransfer.java
Outdated
Show resolved
Hide resolved
public String toString() { | ||
return ToString.builder("ResumableFileDownload") | ||
.add("downloadFileRequest", downloadFileRequest) | ||
.add("bytesTransferred", bytesTransferred) | ||
.add("lastModified", lastModified) | ||
.add("transferSizeInBytes", transferSizeInBytes) | ||
.build(); |
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.
This method will be implemented in a separate PR as part of serialization/deserialization APIs
7650a0e
to
035838c
Compare
Kudos, SonarCloud Quality Gate passed! |
* [TM DownloadFile Pause and Resume] Part 1: Add configuration to enable overwriting existing files (#3125) * Expose an option to overwrite an existing file in FileAsyncResponseTransformer * Add changelog entries and make TM use CREATE_OR_REPLACE_EXISTING write option by default * Address feedback * Update and address feedback * [TM DownloadFile Pause and Resume] Part 2: Implement pause for downloadFile operation (#3094) * Part 1: Implement pause for downloadFile operation * Address feedback * Refactor the logic * Address feedback * Fix merging issue * [TM DownloadFile Pause and Resume] Part 3: Implement resumeDownloadFile (#3157) * Implement resumeDownloadFile * Move test code around * Address feedback * Fix flaky test * fix flaky integ test * add changelog entry * Troubleshooting flaky test * Add file length check when checking if file has modified or not * Address feedback
Modifications
Implement
S3TransferManager#resumeDownloadFile
.Below is the workflow for resume
Testing
Added unit tests and functional tests