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

feat(cli): add download batch-size option #992

Merged
merged 2 commits into from Nov 22, 2023

Conversation

joshuef
Copy link
Contributor

@joshuef joshuef commented Nov 22, 2023

Sets default to 1/4 of upload

Description

Summary generated by Reviewpad on 22 Nov 23 09:07 UTC

This pull request adds a new option for the batch size in the command line interface (CLI) for parallel handling of chunks during payment and upload processing. Additionally, it also adds a batch size option for parallel downloading. The default value for the download batch size is set to one-fourth of the upload batch size. The changes are made in the sn_cli/src/subcommands/files/mod.rs and sn_client/src/file_apis.rs files. The patch adds new command line options and modifies the files_cmds function to handle the new batch size options. It also adds new functions download_files, download_file, and modifies the verify_and_repay_if_needed_once function to accommodate the new batch size option for parallel downloading.

@@ -426,7 +428,10 @@ impl Files {
return Ok(data_map);
}
DataMapLevel::Additional(data_map) => {
let serialized_chunk = self.read_all(data_map, None, false).await?.unwrap();
let serialized_chunk = self
.read_all(data_map, None, false, BATCH_SIZE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we pass the batch_size arg here instead of using the const?

@joshuef joshuef added this pull request to the merge queue Nov 22, 2023
Merged via the queue into maidsafe:main with commit 0e89255 Nov 22, 2023
29 checks passed
@joshuef joshuef deleted the DownloadBatchSize branch November 22, 2023 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Small Pull request is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants