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


##########
be/src/pipeline/pipeline_x/dependency.cpp:
##########
@@ -21,10 +21,127 @@
 #include <mutex>
 
 #include "common/logging.h"
+#include "pipeline/pipeline_fragment_context.h"
+#include "pipeline/pipeline_task.h"
+#include "pipeline/pipeline_x/pipeline_x_task.h"
 #include "runtime/memory/mem_tracker.h"
 
 namespace doris::pipeline {
 
+void Dependency::add_block_task(PipelineXTask* task) {
+    // TODO(gabriel): support read dependency
+    if (!_blocked_task.empty() && _blocked_task[_blocked_task.size() - 1] == 
task) {
+        return;
+    }
+    _blocked_task.push_back(task);
+}
+
+void WriteDependency::add_write_block_task(PipelineXTask* task) {

Review Comment:
   warning: method 'add_write_block_task' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/pipeline/pipeline_x/dependency.h:150:
   ```diff
   -     void add_write_block_task(PipelineXTask* task);
   +     static void add_write_block_task(PipelineXTask* task);
   ```
   



##########
be/src/pipeline/pipeline_x/pipeline_x_task.h:
##########
@@ -147,17 +117,76 @@ 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 _use_blocking_queue || get_state() == 
PipelineTaskState::BLOCKED_FOR_DEPENDENCY;
+    }
+    bool pending_finish() override { return _is_pending_finish; }
+    bool set_is_pending_finish() { return _is_pending_finish = true; }
+
 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() {

Review Comment:
   warning: method '_finish_blocked_dependency' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static Dependency* _finish_blocked_dependency() {
   ```
   



-- 
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