-
Notifications
You must be signed in to change notification settings - Fork 706
Feat S3 Transfer Manager v2 DownloadDirectory #3163
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
base: main
Are you sure you want to change the base?
Conversation
|
||
// A callback function to allow customers to update individual | ||
// GetObjectInput that the S3 Transfer Manager generates | ||
Callback GetRequestCallback |
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.
You seem to be missing a few inputs from the SEP
- recursive
- failurePolicy
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.
Talked offline, design for these seems to be somewhat in-flux so we can defer for now.
return i.downloadDirectory(ctx) | ||
} | ||
|
||
type directoryDownloader struct { |
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.
Progress listener support?
if !ok { | ||
break | ||
} | ||
if d.getErr() != nil { |
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.
You should likely also be checking for context cancellation here (after the channel read).
break | ||
} | ||
|
||
err = os.MkdirAll(filepath.Dir(data.path), os.ModePerm) |
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.
os.ModePerm
is 0777, i.e. anyone on the system can read/write/execute/cd into it. I doubt that's what we want to set here. I don't see a set of default permissions mentioned in the SEP, I would seek clarification from the authors.
Implement v2 s3 transfer manager's DownloadDirectory api bound to single union client which mimics normal service client's initialization and api call. User could now download a bucket's objects to local directory with customized filtering and file naming in a single operation call.
Test: This PR passed unit tests for DownloadDirectory which covers use cases with different config and objects naming to confirm this key-prefix downloader could find valid objects, generate correct file path and pass download requests to S3 concurrently. It also passed integration test which uploads objects with different sizes to S3 via S3 client, then downloads objects back using new directory downloader and checks their content consistency