-
Notifications
You must be signed in to change notification settings - Fork 2
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
re-organize crate structure part one #36
Conversation
&self.target_part_size | ||
} | ||
|
||
// TODO(design) - should we separate upload/download part size and concurrency settings? |
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.
I think not. I can see them each having different defaults but I'd be surprised if they had exclusive settings.
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.
Download doesn't have a minimum part size of 5 MiB though. We can do downloads in smaller ranges (if of course it is beneficial to do so).
let ctx = new_context(handle, input); | ||
let mut handle = UploadHandle::new(ctx); | ||
|
||
// MPU has max of 10K parts which requires us to know the upper bound on the content length (today anyway) |
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.
A comment implicitly refers to the current state of the code.
// MPU has max of 10K parts which requires us to know the upper bound on the content length (today anyway) | |
// MPU has max of 10K parts which requires us to know the upper bound on the content length |
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.
the "today anyway" refers to the current state of S3. It might very well be different in a few years if S3 bumps up its max object size
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.
LGTM. FYI, src/io
contains the old style of mod.rs
whereas the rest of the repo doesn't follow that style. We probably want src/io/mod.rs
to follow the rest of the repo, but that cleanup doesn't have to be done in this PR.
I don't know that I agree. We use e.g.
vs
I think each has their place personally. If others feel strongly on favoring only one style though it's not a hill I want to die on. |
FYI, that is a leftover before we had switched to without-mod-rs world in |
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.
I left some rambling comments, but I see now how this mirrors the organization of the SDK, so like ... I get it
.client(s3_client) | ||
.build(); | ||
|
||
let tm = aws_s3_transfer_manager::Client::new(tm_config); |
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 it be confusing to call it aws_s3_transfer_manager::Client
but also the aws_sdk_s3::Client
is in the mix? User code is going to end up with 2 "S3 clients". Should it be aws_s3_transfer_manager::TransferManager
instead?
Or is that just normal? Everything is a "::Client", it's namespaced by the module name, and users are used to that, and give good disambiguating variable names when they both appear side-by-side
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.
I'm going to leave it for now but feel free to add it to the bikeshed issue. I can go either way, I do think it's redundant a bit when the crate/module name has transfer manager in it, though the SEP says it should be named TransferManager
so maybe we call it that. Users can give an alias to an import to disambiguate e.g. use aws_s3_transfer_manager::Client as TransferManager
. Also my hope is that the need for users to instantiate their own aws_sdk_s3::Client
is rare when we add some convenience "loader" functions.
/// } | ||
/// | ||
/// ``` | ||
pub fn upload(&self) -> crate::operation::upload::builders::UploadFluentBuilder { |
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.
I was going to say it seems it weird that the returned type has such a long module path, and wondered if we want to shorten it at least for public consumption? But I see that this mirrors the path to aws_sdk_s3's fluent builders, so it's probably good
I'm seeing now how the module organization here really mirrors the SDK's module organization, which seems good to do.
no need to respond. just sharing my mental journey
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.
It makes no difference to the generated docs or how users consume it FWIW. The end result to a user is the same as:
use crate::operation::upload::builders::UploadFluentBuilder;
...
pub fn upload(&self) -> UploadFluentBuilder
/// the multipart upload ID | ||
pub(crate) upload_id: Option<String>, | ||
/// the original request (NOTE: the body will have been taken for processing, only the other fields remain) | ||
pub(crate) request: Arc<UploadRequest>, | ||
pub(crate) request: Arc<UploadInput>, |
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.
pub(crate) request: Arc<UploadInput>, | |
pub(crate) input: Arc<UploadInput>, |
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.
I'll take another pass at cleaning up request/response naming in following PR(s). Good catch.
Issue #, if available:
#35
Description of changes:
In order to keep these PRs somewhat reasonable I'm going to stop here but we aren't done. This is the first of likely 2-3 PRs to get to the desired state.
NOTE: This PR does not change any implementation details of upload/download. It is largely re-organization. The fluent builder boilerplate adds nearly 1K lines.
Uploader
and move the internals as the implementation details of the newUpload
operation.Client
that transfer operations will be initiated from. Currently onlyupload
is mostly fleshed outFuture PRs
Downloader
and move it's internals into theDownload
operation.io
module but up for debate).By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.