The Wayback Machine - https://web.archive.org/web/20220510195844/https://github.com/rclone/rclone/pull/6138
Skip to content
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

B2: Dynamically adjust --b2-chunk-size when necessary #6138

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Slugger
Copy link

@Slugger Slugger commented May 1, 2022

What is the purpose of this change?

Add support for dynamic modification of --b2-chunk-size when necessary as discussed in #4643.

Created a new package, chunksize that implements a chunk size calculator, which is then called by B2 to dynamically adjust the chunk size when needed. This package was created with the intent to eventually leverage this calculator in all backends that need to do dynamic chunk size adjustments (S3 at a minimum).

Was the change discussed in an issue or in the forum before?

Yes. #4643

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@Slugger Slugger changed the title Feature/4643 b2 dynamic chunk size B2: Dynamically adjust --b2-chunk-size when necessary May 1, 2022
Copy link
Member

@ncw ncw left a comment

Looks like a nice change :-)

I put some comments inline.

In order to accept the new package I'd like you to add a commit which uses it for s3 and another ideally for azureblob - I don't like abstractions which don't get used more than once :-)

I'll run the CI on this too so you can see if it passes or not.

fs/dynchunksize/dynchunksize.go Outdated Show resolved Hide resolved
fs/dynchunksize/dynchunksize.go Outdated Show resolved Hide resolved
fs/dynchunksize/dynchunksize.go Outdated Show resolved Hide resolved
fs/dynchunksize/dynchunksize.go Outdated Show resolved Hide resolved
fs/dynchunksize/dynchunksize.go Outdated Show resolved Hide resolved
@Slugger
Copy link
Author

@Slugger Slugger commented May 3, 2022

Thanks for the feedback. I've addressed all the comments except the implementation in additional backends. I'll do that next time I can put some time in -- some evening hopefully later this week.

Just dipping my toes into the project here with this relatively simple feature request I found in the backlog. Got to say, so far so good. It's always nice to get a super quick, constructive response when starting out in a new project. Looking forward to contributing (I have a big idea, which is what brought me here, but learning to crawl before I try to climb Everest! 😄 ).

@Slugger
Copy link
Author

@Slugger Slugger commented May 3, 2022

Refactored s3 and azureblob to leverage the new chunksize.Calculator()

Copy link
Member

@ncw ncw left a comment

Changes look great - thank you :-)

I'll run the CI now.

Can you squash into 4 commits, one for the chunksize lib, then one for each backend then I'll run the CI one more time and merge - thank you :-)

@Slugger Slugger force-pushed the feature/4643-b2-dynamic-chunk-size branch 2 times, most recently from 749faf6 to 1e977fb Compare May 6, 2022
@Slugger Slugger force-pushed the feature/4643-b2-dynamic-chunk-size branch from 1e977fb to 0778535 Compare May 6, 2022
@Slugger
Copy link
Author

@Slugger Slugger commented May 6, 2022

Linter issues fixed, commits squashed. Everything should be ready to go.

@Slugger Slugger requested a review from ncw May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants