[Improvement](pipeline) Do parallel preparation for multiple fragments#33989
[Improvement](pipeline) Do parallel preparation for multiple fragments#33989Gabriel39 wants to merge 1 commit intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
|
|
||
| template <typename Params> | ||
| Status FragmentMgr::_get_query_ctx(const Params& params, TUniqueId query_id, bool pipeline, | ||
| Status FragmentMgr::_get_query_ctx(Params& params, TUniqueId query_id, bool pipeline, |
There was a problem hiding this comment.
warning: function '_get_query_ctx' has cognitive complexity of 103 (threshold 50) [readability-function-cognitive-complexity]
Status FragmentMgr::_get_query_ctx(Params& params, TUniqueId query_id, bool pipeline,
^Additional context
be/src/runtime/fragment_mgr.cpp:627: +1
const bool enable_pipeline_x = params.query_options.__isset.enable_pipeline_x_engine &&
^be/src/runtime/fragment_mgr.cpp:629: +1, including nesting penalty of 0, nesting level increased to 1
if (enable_pipeline_x && params.__isset.desc_tbl) {
^be/src/runtime/fragment_mgr.cpp:629: +1
if (enable_pipeline_x && params.__isset.desc_tbl) {
^be/src/runtime/fragment_mgr.cpp:632: +2, including nesting penalty of 1, nesting level increased to 2
if (search == _query_ctx_map.end()) {
^be/src/runtime/fragment_mgr.cpp:633: +3, including nesting penalty of 2, nesting level increased to 3
if constexpr (std::is_same_v<Params, TPipelineFragmentParams>) {
^be/src/runtime/fragment_mgr.cpp:643: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(DescriptorTbl::create(&(query_ctx->obj_pool), params.desc_tbl,
^be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'
do { \
^be/src/runtime/fragment_mgr.cpp:643: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(DescriptorTbl::create(&(query_ctx->obj_pool), params.desc_tbl,
^be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^be/src/runtime/fragment_mgr.cpp:646: +3, including nesting penalty of 2, nesting level increased to 3
if (params.__isset.file_scan_params) {
^be/src/runtime/fragment_mgr.cpp:657: +3, including nesting penalty of 2, nesting level increased to 3
if (params.__isset.resource_info) {
^be/src/runtime/fragment_mgr.cpp:666: +3, including nesting penalty of 2, nesting level increased to 3
if (params.__isset.workload_groups && !params.workload_groups.empty()) {
^be/src/runtime/fragment_mgr.cpp:666: +1
if (params.__isset.workload_groups && !params.workload_groups.empty()) {
^be/src/runtime/fragment_mgr.cpp:670: +4, including nesting penalty of 3, nesting level increased to 4
if (workload_group_ptr != nullptr) {
^be/src/runtime/fragment_mgr.cpp:671: +5, including nesting penalty of 4, nesting level increased to 5
RETURN_IF_ERROR(workload_group_ptr->add_query(query_id, query_ctx));
^be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'
do { \
^be/src/runtime/fragment_mgr.cpp:671: +6, including nesting penalty of 5, nesting level increased to 6
RETURN_IF_ERROR(workload_group_ptr->add_query(query_id, query_ctx));
^be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^be/src/runtime/fragment_mgr.cpp:672: +5, including nesting penalty of 4, nesting level increased to 5
RETURN_IF_ERROR(query_ctx->set_workload_group(workload_group_ptr));
^be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'
do { \
^be/src/runtime/fragment_mgr.cpp:672: +6, including nesting penalty of 5, nesting level increased to 6
RETURN_IF_ERROR(query_ctx->set_workload_group(workload_group_ptr));
^be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^be/src/runtime/fragment_mgr.cpp:680: +1, nesting level increased to 4
} else {
^be/src/runtime/fragment_mgr.cpp:685: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(DescriptorTbl::create(&(query_ctx->obj_pool), params.desc_tbl,
^be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'
do { \
^be/src/runtime/fragment_mgr.cpp:685: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(DescriptorTbl::create(&(query_ctx->obj_pool), params.desc_tbl,
^be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^be/src/runtime/fragment_mgr.cpp:693: +1, nesting level increased to 2
} else {
^be/src/runtime/fragment_mgr.cpp:694: +3, including nesting penalty of 2, nesting level increased to 3
if constexpr (std::is_same_v<Params, TPipelineFragmentParams>) {
^be/src/runtime/fragment_mgr.cpp:701: +1, including nesting penalty of 0, nesting level increased to 1
if (params.is_simplified_param) {
^be/src/runtime/fragment_mgr.cpp:705: +2, including nesting penalty of 1, nesting level increased to 2
if (search == _query_ctx_map.end()) {
^be/src/runtime/fragment_mgr.cpp:712: +1, nesting level increased to 1
} else {
^be/src/runtime/fragment_mgr.cpp:717: +2, including nesting penalty of 1, nesting level increased to 2
if (search != _query_ctx_map.end()) {
^be/src/runtime/fragment_mgr.cpp:728: +2, including nesting penalty of 1, nesting level increased to 2
RETURN_IF_ERROR(DescriptorTbl::create(&(query_ctx->obj_pool), params.desc_tbl,
^be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'
do { \
^be/src/runtime/fragment_mgr.cpp:728: +3, including nesting penalty of 2, nesting level increased to 3
RETURN_IF_ERROR(DescriptorTbl::create(&(query_ctx->obj_pool), params.desc_tbl,
^be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^be/src/runtime/fragment_mgr.cpp:731: +2, including nesting penalty of 1, nesting level increased to 2
if (params.__isset.file_scan_params) {
^be/src/runtime/fragment_mgr.cpp:741: +2, including nesting penalty of 1, nesting level increased to 2
if (params.__isset.resource_info) {
^be/src/runtime/fragment_mgr.cpp:751: +2, including nesting penalty of 1, nesting level increased to 2
if (params.__isset.workload_groups && !params.workload_groups.empty()) {
^be/src/runtime/fragment_mgr.cpp:751: +1
if (params.__isset.workload_groups && !params.workload_groups.empty()) {
^be/src/runtime/fragment_mgr.cpp:755: +3, including nesting penalty of 2, nesting level increased to 3
if (workload_group_ptr != nullptr) {
^be/src/runtime/fragment_mgr.cpp:756: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(workload_group_ptr->add_query(query_id, query_ctx));
^be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'
do { \
^be/src/runtime/fragment_mgr.cpp:756: +5, including nesting penalty of 4, nesting level increased to 5
RETURN_IF_ERROR(workload_group_ptr->add_query(query_id, query_ctx));
^be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^be/src/runtime/fragment_mgr.cpp:757: +4, including nesting penalty of 3, nesting level increased to 4
RETURN_IF_ERROR(query_ctx->set_workload_group(workload_group_ptr));
^be/src/common/status.h:541: expanded from macro 'RETURN_IF_ERROR'
do { \
^be/src/runtime/fragment_mgr.cpp:757: +5, including nesting penalty of 4, nesting level increased to 5
RETURN_IF_ERROR(query_ctx->set_workload_group(workload_group_ptr));
^be/src/common/status.h:543: expanded from macro 'RETURN_IF_ERROR'
if (UNLIKELY(!_status_.ok())) { \
^be/src/runtime/fragment_mgr.cpp:766: +1, nesting level increased to 3
} else {
^|
|
||
| template <typename Params> | ||
| Status FragmentMgr::_get_query_ctx(const Params& params, TUniqueId query_id, bool pipeline, | ||
| Status FragmentMgr::_get_query_ctx(Params& params, TUniqueId query_id, bool pipeline, |
There was a problem hiding this comment.
warning: function '_get_query_ctx' exceeds recommended size/complexity thresholds [readability-function-size]
Status FragmentMgr::_get_query_ctx(Params& params, TUniqueId query_id, bool pipeline,
^Additional context
be/src/runtime/fragment_mgr.cpp:625: 153 lines including whitespace and comments (threshold 80)
Status FragmentMgr::_get_query_ctx(Params& params, TUniqueId query_id, bool pipeline,
^
TPC-H: Total hot run time: 38377 ms |
|
TeamCity be ut coverage result: |
|
run buildall |
|
TeamCity be ut coverage result: |
|
run buildall |
|
TeamCity be ut coverage result: |
Proposed changes
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...