github-actions[bot] commented on code in PR #26879: URL: https://github.com/apache/doris/pull/26879#discussion_r1395180189
########## be/src/pipeline/pipeline_x/pipeline_x_task.h: ########## @@ -147,17 +117,78 @@ return _upstream_dependency[id]; } - Status extract_dependencies(); + bool is_pipelineX() const override { return true; } - void push_blocked_task_to_dependency(Dependency* dep) {} + void try_wake_up(Dependency* wake_up_dep); DataSinkOperatorXPtr sink() const { return _sink; } OperatorXPtr source() const { return _source; } OperatorXs operatorXs() { return _operators; } + bool push_blocked_task_to_queue() { + /** + * Push task into blocking queue if: + * 1. This task is blocked (`_blocked_dep` is not nullptr) and `_use_blocking_queue` is true. + * 2. Or this task is blocked by FE two phase execution (BLOCKED_FOR_DEPENDENCY). + */ + return (_blocked_dep && _use_blocking_queue) || + get_state() == PipelineTaskState::BLOCKED_FOR_DEPENDENCY; + } + private: + Dependency* _write_blocked_dependency() { + _blocked_dep = _write_dependencies->write_blocked_by(this); + if (_blocked_dep != nullptr) { + _push_blocked_task_to_dep(); + static_cast<WriteDependency*>(_blocked_dep)->start_write_watcher(); + return _blocked_dep; + } + return nullptr; + } + + Dependency* _finish_blocked_dependency(bool skip_current_dep) { + for (auto* fin_dep : _finish_dependencies) { + if (skip_current_dep && fin_dep == _blocked_dep) { + // `_blocked_dep` has already been ready. + _blocked_dep = nullptr; + continue; + } + _blocked_dep = fin_dep->finish_blocked_by(this); + if (_blocked_dep != nullptr) { + _push_blocked_task_to_dep(); + static_cast<FinishDependency*>(_blocked_dep)->start_finish_watcher(); + return _blocked_dep; + } + } + return nullptr; + } + + Dependency* _read_blocked_dependency() { Review Comment: warning: method '_read_blocked_dependency' can be made static [readability-convert-member-functions-to-static] ```suggestion static Dependency* _read_blocked_dependency() { ``` ########## be/src/pipeline/pipeline_x/pipeline_x_task.h: ########## @@ -147,17 +117,78 @@ class PipelineXTask : public PipelineTask { return _upstream_dependency[id]; } - Status extract_dependencies(); + bool is_pipelineX() const override { return true; } - void push_blocked_task_to_dependency(Dependency* dep) {} + void try_wake_up(Dependency* wake_up_dep); DataSinkOperatorXPtr sink() const { return _sink; } OperatorXPtr source() const { return _source; } OperatorXs operatorXs() { return _operators; } + bool push_blocked_task_to_queue() { + /** + * Push task into blocking queue if: + * 1. This task is blocked (`_blocked_dep` is not nullptr) and `_use_blocking_queue` is true. + * 2. Or this task is blocked by FE two phase execution (BLOCKED_FOR_DEPENDENCY). + */ + return (_blocked_dep && _use_blocking_queue) || + get_state() == PipelineTaskState::BLOCKED_FOR_DEPENDENCY; + } + private: + Dependency* _write_blocked_dependency() { + _blocked_dep = _write_dependencies->write_blocked_by(this); + if (_blocked_dep != nullptr) { + _push_blocked_task_to_dep(); + static_cast<WriteDependency*>(_blocked_dep)->start_write_watcher(); + return _blocked_dep; + } + return nullptr; + } + + Dependency* _finish_blocked_dependency(bool skip_current_dep) { Review Comment: warning: method '_finish_blocked_dependency' can be made static [readability-convert-member-functions-to-static] ```suggestion static Dependency* _finish_blocked_dependency(bool skip_current_dep) { ``` -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org