Skip to content

Commit c9d5081

Browse files
committed
Add config to control whether to download in batch
1 parent c4c37cf commit c9d5081

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

be/src/common/config.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ DEFINE_mInt32(max_download_speed_kbps, "50000");
250250
DEFINE_mInt32(download_low_speed_limit_kbps, "50");
251251
// download low speed time(seconds)
252252
DEFINE_mInt32(download_low_speed_time, "300");
253+
// whether to download small files in batch
254+
DEFINE_mBool(enable_batch_download, "false");
253255

254256
DEFINE_String(sys_log_dir, "");
255257
DEFINE_String(user_function_dir, "${DORIS_HOME}/lib/udf");

be/src/common/config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ DECLARE_mInt32(max_download_speed_kbps);
298298
DECLARE_mInt32(download_low_speed_limit_kbps);
299299
// download low speed time(seconds)
300300
DECLARE_mInt32(download_low_speed_time);
301+
// whether to download small files in batch.
302+
DECLARE_mBool(enable_batch_download);
301303

302304
// deprecated, use env var LOG_DIR in be.conf
303305
DECLARE_String(sys_log_dir);

be/src/olap/task/engine_clone_task.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ Status EngineCloneTask::_make_and_download_snapshots(DataDir& data_dir,
415415
}
416416

417417
std::string address = get_host_port(src.host, src.http_port);
418-
if (is_support_batch_download(address).ok()) {
418+
if (config::enable_batch_download && is_support_batch_download(address).ok()) {
419419
// download files via batch api.
420420
LOG_INFO("remote BE supports batch download, use batch file download")
421421
.tag("address", address)
@@ -429,9 +429,15 @@ Status EngineCloneTask::_make_and_download_snapshots(DataDir& data_dir,
429429
continue; // Try another BE
430430
}
431431
} else {
432-
LOG_INFO("remote BE does not support batch download, use single file download")
433-
.tag("address", address)
434-
.tag("remote_dir", remote_dir);
432+
if (config::enable_batch_download) {
433+
LOG_INFO("remote BE does not support batch download, use single file download")
434+
.tag("address", address)
435+
.tag("remote_dir", remote_dir);
436+
} else {
437+
LOG_INFO("batch download is disabled, use single file download")
438+
.tag("address", address)
439+
.tag("remote_dir", remote_dir);
440+
}
435441

436442
std::string remote_url_prefix;
437443
{

0 commit comments

Comments
 (0)