[FEAT MERGE] resource manage patch to direct_load_res_patch431

Co-authored-by: coolfishchen <coolfishchen@gmail.com>
This commit is contained in:
obdev
2024-04-16 15:43:57 +00:00
committed by ob-robot
parent b6c3718f1b
commit 3aff0d6be3
52 changed files with 3210 additions and 170 deletions

View File

@ -1872,9 +1872,6 @@ int ObLoadDataDirectImpl::init_execute_param()
} else {
hint_parallel = hint_parallel > 0 ? hint_parallel : DEFAULT_PARALLEL_THREAD_COUNT;
execute_param_.parallel_ = hint_parallel;
execute_param_.thread_count_ = MIN(hint_parallel, (int64_t)tenant->unit_max_cpu() * 2);
execute_param_.data_mem_usage_limit_ =
MIN(execute_param_.thread_count_ * 2, MAX_DATA_MEM_USAGE_LIMIT);
}
}
// batch_row_count_
@ -2032,7 +2029,7 @@ int ObLoadDataDirectImpl::init_execute_context()
load_param.tenant_id_ = execute_param_.tenant_id_;
load_param.table_id_ = execute_param_.table_id_;
load_param.parallel_ = execute_param_.parallel_;
load_param.session_count_ = execute_param_.thread_count_;
load_param.session_count_ = execute_param_.parallel_;
load_param.batch_size_ = execute_param_.batch_row_count_;
load_param.max_error_row_count_ = execute_param_.max_error_rows_;
load_param.column_count_ = execute_param_.store_column_idxs_.count();
@ -2051,6 +2048,15 @@ int ObLoadDataDirectImpl::init_execute_context()
execute_ctx_.direct_loader_ = &direct_loader_;
execute_ctx_.job_stat_ = direct_loader_.get_job_stat();
execute_ctx_.logger_ = &logger_;
const ObTableLoadTableCtx *tmp_ctx = nullptr;
if (OB_ISNULL(tmp_ctx = direct_loader_.get_table_ctx())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("fail to get table ctx", KR(ret));
} else {
execute_param_.thread_count_ = tmp_ctx->param_.write_session_count_;
execute_param_.data_mem_usage_limit_ = MIN(execute_param_.thread_count_ * 2, MAX_DATA_MEM_USAGE_LIMIT);
tmp_ctx = nullptr;
}
}
return ret;
}

View File

@ -71,7 +71,7 @@ int ObTableDirectInsertCtx::init(ObExecContext *exec_ctx,
param.table_id_ = table_id;
param.batch_size_ = 100;
param.parallel_ = parallel;
param.session_count_ = MIN(parallel, (int64_t)tenant->unit_max_cpu() * 2);
param.session_count_ = parallel;
param.px_mode_ = true;
param.online_opt_stat_gather_ = true;
param.need_sort_ = true;