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

分range并发下载的并发数调整说明 #15928

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ String localFilePath = "/path/to/localFile";
File downloadFile = new File(localFilePath);

GetObjectRequest getObjectRequest = new GetObjectRequest(bucketName, key);
getObjectRequest.setDownloadPartsThreads(4); // 设置分 range 多线程同时下载的并发数,不设置默认为1(此参数在5.6.168及以上版本支持)
try {
// 返回一个异步结果 Download, 可同步的调用 waitForCompletion 等待下载结束, 成功返回 void, 失败抛出异常
Download download = transferManager.download(getObjectRequest, downloadFile, true);
Expand Down Expand Up @@ -181,6 +182,7 @@ shutdownTransferManager(transferManager);
| resumableTaskFile | 断点续传下载时记录信息文件名 | String | file.cosresumabletask |
| multiThreadThreshold | 断点续传下载使用多线程下载的最小文件大小 | int | 20 * 1024 * 1024 |
| partSize | 断点续传下载使用的分块大小 | int | 8 * 1024 * 1024 |
| downloadPartsThreads | 分 range 多线程同时下载的并发数(5.6.168及以上版本支持) | int | 1 |

Request 成员说明:

Expand Down
Loading