This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 1fbf32ead24ea26de18b49abd05f8b8e493f65ba
Author: yiguolei <[email protected]>
AuthorDate: Mon Feb 26 21:33:43 2024 +0800

    [enhancement](pipelinex) limit add_child to and dependency to avoid error 
(#31394)
    
    Co-authored-by: yiguolei <[email protected]>
---
 be/src/pipeline/pipeline_x/dependency.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/be/src/pipeline/pipeline_x/dependency.h 
b/be/src/pipeline/pipeline_x/dependency.h
index ccb919c7edf..3de90fa915a 100644
--- a/be/src/pipeline/pipeline_x/dependency.h
+++ b/be/src/pipeline/pipeline_x/dependency.h
@@ -96,7 +96,9 @@ public:
 
     [[nodiscard]] int id() const { return _id; }
     [[nodiscard]] virtual std::string name() const { return _name; }
-    void add_child(std::shared_ptr<Dependency> child) { 
_children.push_back(child); }
+    virtual void add_child(std::shared_ptr<Dependency> child) {
+        LOG(FATAL) << "Only AndDependency could add child, it is wrong usage";
+    }
     BasicSharedState* shared_state() { return _shared_state; }
     void set_shared_state(BasicSharedState* shared_state) { _shared_state = 
shared_state; }
     virtual std::string debug_string(int indentation_level = 0);
@@ -333,6 +335,8 @@ public:
 
     std::string debug_string(int indentation_level = 0) override;
 
+    void add_child(std::shared_ptr<Dependency> child) override { 
_children.push_back(child); }
+
     [[nodiscard]] Dependency* is_blocked_by(PipelineXTask* task) override {
         for (auto& child : Dependency::_children) {
             if (auto* dep = child->is_blocked_by(task)) {


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

Reply via email to