-
Notifications
You must be signed in to change notification settings - Fork 916
add completed to ResumableFileDownload ser/des #5254
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
add completed to ResumableFileDownload ser/des #5254
Conversation
ResumableFileDownloadSerializerTest
* @return part numbers of a multipart download that were completed saved to file. | ||
*/ | ||
public List<Integer> completedParts() { | ||
return Collections.unmodifiableList(completedParts); |
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.
Can we wrap with umodifableList in the ctor instead of the getter? Also, we should probably create a new list. Example: https://github.com/aws/aws-sdk-java-v2/blob/master/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/ClientOverrideConfiguration.java#L148
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.
will address in full resume PR
@@ -61,6 +63,7 @@ public final class ResumableFileDownload implements ResumableTransfer, | |||
private final Instant s3ObjectLastModified; | |||
private final Long totalSizeInBytes; | |||
private final Instant fileLastModified; | |||
private final List<Integer> completedParts; |
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 the reason for List that we may download different parts in parallel in the future?
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.
yes, trying to prepare for when we will do parallel write to file as well
Add
completedParts
field toResumableFileDownload
with required serialization and deserialization.Motivation and Context
Needed to Multipart Pause/Resume logic. The
ResumableFileDownload
can be serialized to json and deserialized back into memory to resume a download for it.Modifications
ResumableFileDownload
+ BuilderTransferManagerJsonUnmarshaller
for list of IntegercompletedParts
listTesting
Added unit tests