github-actions[bot] commented on code in PR #33542:
URL: https://github.com/apache/doris/pull/33542#discussion_r1560711005


##########
be/src/pipeline/exec/exchange_sink_operator.cpp:
##########
@@ -289,6 +275,12 @@
     }
 
     _finish_dependency->block();
+
+    return Status::OK();
+}
+
+Status ExchangeSinkLocalState::open(RuntimeState* state) {

Review Comment:
   warning: method 'open' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/pipeline/exec/exchange_sink_operator.h:108:
   ```diff
   -     Status open(RuntimeState* state) override;
   +     static Status open(RuntimeState* state) override;
   ```
   



##########
be/src/pipeline/exec/hashjoin_build_sink.cpp:
##########
@@ -121,6 +110,14 @@ Status HashJoinBuildSinkLocalState::open(RuntimeState* 
state) {
 
     _runtime_filter_slots =
             std::make_shared<VRuntimeFilterSlots>(_build_expr_ctxs, 
runtime_filters());
+
+    return Status::OK();
+}
+
+Status HashJoinBuildSinkLocalState::open(RuntimeState* state) {

Review Comment:
   warning: method 'open' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/pipeline/exec/hashjoin_build_sink.h:57:
   ```diff
   -     Status open(RuntimeState* state) override;
   +     static Status open(RuntimeState* state) override;
   ```
   



##########
be/src/pipeline/exec/nested_loop_join_build_operator.cpp:
##########
@@ -30,8 +30,8 @@ 
NestedLoopJoinBuildSinkLocalState::NestedLoopJoinBuildSinkLocalState(DataSinkOpe
         : JoinBuildSinkLocalState<NestedLoopJoinSharedState, 
NestedLoopJoinBuildSinkLocalState>(
                   parent, state) {}
 
-Status NestedLoopJoinBuildSinkLocalState::open(RuntimeState* state) {
-    RETURN_IF_ERROR(JoinBuildSinkLocalState::open(state));
+Status NestedLoopJoinBuildSinkLocalState::init(RuntimeState* state, 
LocalSinkStateInfo& info) {

Review Comment:
   warning: method 'init' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/pipeline/exec/nested_loop_join_build_operator.h:57:
   ```diff
   -     Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
   +     static Status init(RuntimeState* state, LocalSinkStateInfo& info) 
override;
   ```
   



##########
be/src/pipeline/exec/exchange_sink_operator.cpp:
##########
@@ -99,12 +99,10 @@ bool ExchangeSinkLocalState::transfer_large_data_by_brpc() 
const {
     return _parent->cast<ExchangeSinkOperatorX>()._transfer_large_data_by_brpc;
 }
 
-static const std::string timer_name = "WaitForDependencyTime";
-
 Status ExchangeSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& 
info) {

Review Comment:
   warning: function 'init' has cognitive complexity of 56 (threshold 50) 
[readability-function-cognitive-complexity]
   ```cpp
   Status ExchangeSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& 
info) {
                                  ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/exec/exchange_sink_operator.cpp:102:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
       RETURN_IF_ERROR(Base::init(state, info));
       ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:102:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
       RETURN_IF_ERROR(Base::init(state, info));
       ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:104:** nesting level 
increased to 1
   ```cpp
       SCOPED_TIMER(_open_timer);
       ^
   ```
   **be/src/util/runtime_profile.h:67:** expanded from macro 'SCOPED_TIMER'
   ```cpp
   #define SCOPED_TIMER(c) ScopedTimer<MonotonicStopWatch> 
MACRO_CONCAT(SCOPED_TIMER, __COUNTER__)(c)
                           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:135:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
       for (int i = 0; i < p._dests.size(); ++i) {
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:137:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (fragment_id_to_channel_index.find(fragment_instance_id.lo) ==
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:145:** +1, nesting level 
increased to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:159:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (_part_type == TPartitionType::UNPARTITIONED || _part_type == 
TPartitionType::RANDOM ||
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:178:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
       if ((_part_type == TPartitionType::UNPARTITIONED || channels.size() == 
1) &&
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:185:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (int i = 0; i < config::num_broadcast_buffer; ++i) {
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:191:** +1, nesting level 
increased to 1
   ```cpp
       } else if (local_size > 0) {
              ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:206:** +1, including 
nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (_part_type == TPartitionType::HASH_PARTITIONED) {
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:210:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:210:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:211:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:211:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:214:** +1, nesting level 
increased to 1
   ```cpp
       } else if (_part_type == 
TPartitionType::BUCKET_SHFFULE_HASH_PARTITIONED) {
              ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:218:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:218:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:219:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:219:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:222:** +1, nesting level 
increased to 1
   ```cpp
       } else if (_part_type == 
TPartitionType::TABLET_SINK_SHUFFLE_PARTITIONED) {
              ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:228:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_schema->init(p._tablet_sink_schema));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:228:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_schema->init(p._tablet_sink_schema));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:230:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_vpartition->init());
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:230:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_vpartition->init());
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:253:** +1, nesting level 
increased to 1
   ```cpp
       } else if (_part_type == TPartitionType::TABLE_SINK_HASH_PARTITIONED) {
              ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:270:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:270:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->init(p._texprs));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:271:** +2, including 
nesting penalty of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/exec/exchange_sink_operator.cpp:271:** +3, including 
nesting penalty of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           ^
   ```
   **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   
   </details>
   



##########
be/src/pipeline/exec/olap_table_sink_v2_operator.h:
##########
@@ -52,6 +52,13 @@ class OlapTableSinkV2LocalState final
     ENABLE_FACTORY_CREATOR(OlapTableSinkV2LocalState);
     OlapTableSinkV2LocalState(DataSinkOperatorXBase* parent, RuntimeState* 
state)
             : Base(parent, state) {};
+    Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
+    Status open(RuntimeState* state) override {

Review Comment:
   warning: method 'open' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static Status open(RuntimeState* state) override {
   ```
   



##########
be/src/pipeline/exec/olap_table_sink_operator.cpp:
##########
@@ -29,6 +29,15 @@ OperatorPtr OlapTableSinkOperatorBuilder::build_operator() {
     return std::make_shared<OlapTableSinkOperator>(this, _sink);
 }
 
+Status OlapTableSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& 
info) {

Review Comment:
   warning: method 'init' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/pipeline/exec/olap_table_sink_operator.h:54:
   ```diff
   -     Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
   +     static Status init(RuntimeState* state, LocalSinkStateInfo& info) 
override;
   ```
   



##########
be/src/pipeline/exec/spill_sort_sink_operator.cpp:
##########
@@ -74,7 +72,10 @@ void SpillSortSinkLocalState::update_profile(RuntimeProfile* 
child_profile) {
     UPDATE_PROFILE(_merge_block_timer, "MergeBlockTime");
     UPDATE_PROFILE(_sort_blocks_memory_usage, "SortBlocks");
 }
-
+Status SpillSortSinkLocalState::open(RuntimeState* state) {

Review Comment:
   warning: method 'open' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/pipeline/exec/spill_sort_sink_operator.h:37:
   ```diff
   -     Status open(RuntimeState* state) override;
   +     static Status open(RuntimeState* state) override;
   ```
   



##########
be/src/pipeline/exec/olap_table_sink_operator.h:
##########
@@ -52,6 +52,12 @@ class OlapTableSinkLocalState final
     ENABLE_FACTORY_CREATOR(OlapTableSinkLocalState);
     OlapTableSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state)
             : Base(parent, state) {};
+    Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
+    Status open(RuntimeState* state) override {

Review Comment:
   warning: method 'open' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static Status open(RuntimeState* state) override {
   ```
   



##########
be/src/vec/sink/volap_table_sink.cpp:
##########
@@ -122,7 +122,13 @@ namespace vectorized {
 
 VOlapTableSink::VOlapTableSink(ObjectPool* pool, const RowDescriptor& row_desc,
                                const std::vector<TExpr>& texprs)
-        : AsyncWriterSink<VTabletWriter, VOLAP_TABLE_SINK>(row_desc, texprs) {}
+        : AsyncWriterSink<VTabletWriter, VOLAP_TABLE_SINK>(row_desc, texprs), 
_pool(pool) {}
+
+Status VOlapTableSink::init(const TDataSink& t_sink) {

Review Comment:
   warning: method 'init' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/vec/sink/volap_table_sink.h:89:
   ```diff
   -     Status init(const TDataSink& sink) override;
   +     static Status init(const TDataSink& sink) override;
   ```
   



##########
be/src/pipeline/exec/repeat_operator.cpp:
##########
@@ -47,10 +47,10 @@ RepeatLocalState::RepeatLocalState(RuntimeState* state, 
OperatorXBase* parent)
           _child_block(vectorized::Block::create_unique()),
           _repeat_id_idx(0) {}
 
-Status RepeatLocalState::open(RuntimeState* state) {
+Status RepeatLocalState::init(RuntimeState* state, LocalStateInfo& info) {

Review Comment:
   warning: method 'init' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/pipeline/exec/repeat_operator.h:56:
   ```diff
   -     Status init(RuntimeState* state, LocalStateInfo& info) override;
   +     static Status init(RuntimeState* state, LocalStateInfo& info) override;
   ```
   



##########
be/src/vec/sink/volap_table_sink_v2.cpp:
##########
@@ -39,10 +39,16 @@ namespace vectorized {
 
 VOlapTableSinkV2::VOlapTableSinkV2(ObjectPool* pool, const RowDescriptor& 
row_desc,
                                    const std::vector<TExpr>& texprs)
-        : AsyncWriterSink<VTabletWriterV2, VOLAP_TABLE_SINK_V2>(row_desc, 
texprs) {}
+        : AsyncWriterSink<VTabletWriterV2, VOLAP_TABLE_SINK_V2>(row_desc, 
texprs), _pool(pool) {}
 
 VOlapTableSinkV2::~VOlapTableSinkV2() = default;
 
+Status VOlapTableSinkV2::init(const TDataSink& t_sink) {

Review Comment:
   warning: method 'init' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/vec/sink/volap_table_sink_v2.h:58:
   ```diff
   -     Status init(const TDataSink& sink) override;
   +     static Status init(const TDataSink& sink) override;
   ```
   



##########
be/src/pipeline/exec/olap_table_sink_v2_operator.cpp:
##########
@@ -25,6 +25,15 @@ OperatorPtr OlapTableSinkV2OperatorBuilder::build_operator() 
{
     return std::make_shared<OlapTableSinkV2Operator>(this, _sink);
 }
 
+Status OlapTableSinkV2LocalState::init(RuntimeState* state, 
LocalSinkStateInfo& info) {

Review Comment:
   warning: method 'init' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/pipeline/exec/olap_table_sink_v2_operator.h:54:
   ```diff
   -     Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
   +     static Status init(RuntimeState* state, LocalSinkStateInfo& info) 
override;
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to