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


##########
be/src/pipeline/pipeline_x/pipeline_x_task.h:
##########
@@ -94,34 +94,28 @@ class PipelineXTask : public PipelineTask {
 
     bool is_pending_finish() override { return _finish_blocked_dependency() != 
nullptr; }
 
-    std::vector<DependencySPtr>& get_downstream_dependency() { return 
_downstream_dependency; }
-    std::map<int, std::shared_ptr<BasicSharedState>>& get_shared_states() { 
return _shared_states; }
-
-    void add_upstream_dependency(std::vector<DependencySPtr>& 
multi_upstream_dependency,
-                                 std::map<int, 
std::shared_ptr<BasicSharedState>>& shared_states) {
-        for (auto dep : multi_upstream_dependency) {
-            int dst_id = dep->id();
-            if (!_upstream_dependency.contains(dst_id)) {
-                _upstream_dependency.insert({dst_id, {dep}});
-            } else {
-                _upstream_dependency[dst_id].push_back(dep);
-            }
+    std::shared_ptr<BasicSharedState> get_sink_shared_state() {
+        return _shared_states.contains(_sink->operator_id()) ? 
_shared_states[_sink->operator_id()]
+                                                             : nullptr;
+    }
 
-            if (shared_states.contains(dst_id) && 
!_shared_states.contains(dst_id)) {
-                // Shared state is created by upstream task's sink operator 
and shared by source operator of this task.
-                _shared_states.insert({dst_id, shared_states[dst_id]});
-            } else if (_shared_states.contains(dst_id) && 
!shared_states.contains(dst_id)) {
-                // Shared state is created by this task's source operator and 
shared by upstream task's sink operator.
-                shared_states.insert({dst_id, _shared_states[dst_id]});
-            }
-        }
+    std::shared_ptr<BasicSharedState> get_source_shared_state() {
+        DCHECK(_shared_states.contains(_source->operator_id()));
+        return _shared_states[_source->operator_id()];
     }
 
-    std::vector<DependencySPtr>& get_upstream_dependency(int id) {
-        if (_upstream_dependency.find(id) == _upstream_dependency.end()) {
-            _upstream_dependency.insert({id, {}});
+    void inject_shared_state(std::shared_ptr<BasicSharedState> shared_state) {

Review Comment:
   warning: method 'inject_shared_state' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static void inject_shared_state(std::shared_ptr<BasicSharedState> 
shared_state) {
   ```
   



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