zxealous commented on code in PR #21634:
URL: https://github.com/apache/doris/pull/21634#discussion_r1257668515


##########
be/src/runtime/load_channel_mgr.h:
##########
@@ -89,24 +88,35 @@ class LoadChannelMgr {
                                        _mem_tracker.get());
     }
 
+    void _register_channel_all_writers(std::shared_ptr<doris::LoadChannel> 
channel) {
+        for (auto& tablet_channel_it : channel->get_tablets_channels()) {
+            for (auto& writer_it : 
tablet_channel_it.second->get_tablet_writers()) {
+                _memtable_flush_mgr->register_writer(writer_it.second);
+            }
+        }
+    }
+
+    void _deregister_channel_all_writers(std::shared_ptr<doris::LoadChannel> 
channel) {
+        for (auto& tablet_channel_it : channel->get_tablets_channels()) {
+            for (auto& writer_it : 
tablet_channel_it.second->get_tablet_writers()) {
+                _memtable_flush_mgr->deregister_writer(writer_it.second);
+            }
+        }
+    }
+
 protected:
     // lock protect the load channel map
     std::mutex _lock;
     // load id -> load channel
     std::unordered_map<UniqueId, std::shared_ptr<LoadChannel>> _load_channels;
     Cache* _last_success_channel = nullptr;
 
-    // check the total load channel mem consumption of this Backend

Review Comment:
   we can keep this comment



##########
be/src/runtime/load_channel_mgr.h:
##########
@@ -89,24 +88,35 @@ class LoadChannelMgr {
                                        _mem_tracker.get());
     }
 
+    void _register_channel_all_writers(std::shared_ptr<doris::LoadChannel> 
channel) {
+        for (auto& tablet_channel_it : channel->get_tablets_channels()) {
+            for (auto& writer_it : 
tablet_channel_it.second->get_tablet_writers()) {
+                _memtable_flush_mgr->register_writer(writer_it.second);
+            }
+        }
+    }
+
+    void _deregister_channel_all_writers(std::shared_ptr<doris::LoadChannel> 
channel) {
+        for (auto& tablet_channel_it : channel->get_tablets_channels()) {
+            for (auto& writer_it : 
tablet_channel_it.second->get_tablet_writers()) {
+                _memtable_flush_mgr->deregister_writer(writer_it.second);
+            }
+        }
+    }
+
 protected:
     // lock protect the load channel map
     std::mutex _lock;
     // load id -> load channel
     std::unordered_map<UniqueId, std::shared_ptr<LoadChannel>> _load_channels;
     Cache* _last_success_channel = nullptr;
 
-    // check the total load channel mem consumption of this Backend

Review Comment:
   we can keep this comment



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