yiguolei commented on code in PR #45375:
URL: https://github.com/apache/doris/pull/45375#discussion_r1961259312


##########
be/src/pipeline/exec/exchange_sink_operator.h:
##########
@@ -37,6 +37,87 @@ class TDataSink;
 
 namespace pipeline {
 
+using ChannelId = int;
+using ChannelIds = std::vector<ChannelId>;
+class ChannelSelector {
+public:
+    virtual ~ChannelSelector() = default;
+    virtual ChannelIds& next_channel_ids() = 0;
+    virtual void process_next_block(size_t data_size) = 0;
+    virtual void reset_selected_channel() {}
+    virtual void select_channel(ChannelId idx) {}
+};
+
+class AllChannelsSelector final : public ChannelSelector {
+public:
+    AllChannelsSelector(size_t num_channels) : ChannelSelector(), 
_all_channel_ids(num_channels) {
+        for (int i = 0; i < num_channels; i++) {
+            _all_channel_ids[i] = i;
+        }
+    }
+    ~AllChannelsSelector() override = default;
+    ChannelIds& next_channel_ids() override { return _all_channel_ids; }
+    void process_next_block(size_t data_size) override {}
+
+private:
+    ChannelIds _all_channel_ids;
+};
+
+class SelectedChannelsSelector final : public ChannelSelector {
+public:
+    SelectedChannelsSelector(size_t num_channels)
+            : ChannelSelector(), _selected_channel_ids(num_channels) {}
+    ~SelectedChannelsSelector() override = default;
+    ChannelIds& next_channel_ids() override { return _selected_channel_ids; }
+    void process_next_block(size_t data_size) override {}
+    void reset_selected_channel() override { _selected_channel_ids.clear(); }
+    void select_channel(ChannelId idx) override { 
_selected_channel_ids.push_back(idx); }
+
+private:
+    ChannelIds _selected_channel_ids;
+};
+
+class RoundRobinSelector final : public ChannelSelector {

Review Comment:
   所有的selector 统一命名为  XXXChannelSelector



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

Reply via email to