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


##########
be/src/agent/topic_subscriber.cpp:
##########
@@ -29,37 +29,41 @@ namespace doris {
 TopicSubscriber::TopicSubscriber() {}
 
 TopicSubscriber::~TopicSubscriber() {
-    // Delete all listeners in the register
-    std::map<TTopicType::type, std::vector<TopicListener*>>::iterator it =
-            _registered_listeners.begin();
-    for (; it != _registered_listeners.end(); ++it) {
-        std::vector<TopicListener*>& listeners = it->second;
-        std::vector<TopicListener*>::iterator listener_it = listeners.begin();
-        for (; listener_it != listeners.end(); ++listener_it) {
-            delete *listener_it;
-        }
+    auto iter = _registered_listeners.begin();
+    for (; iter != _registered_listeners.end(); iter++) {
+        delete iter->second;
     }
 }
 
-void TopicSubscriber::register_listener(TTopicType::type topic_type, 
TopicListener* listener) {
+void TopicSubscriber::register_listener(TTopicInfoType::type topic_type,
+                                        TopicListener* topic_listener) {
     // Unique lock here to prevent access to listeners
     std::lock_guard<std::shared_mutex> lock(_listener_mtx);
-    this->_registered_listeners[topic_type].push_back(listener);
+    this->_registered_listeners.emplace(topic_type, topic_listener);
 }
 
-void TopicSubscriber::handle_updates(const TAgentPublishRequest& 
agent_publish_request) {
+void TopicSubscriber::handle_topic_info(const TPublishTopicRequest& 
topic_request) {

Review Comment:
   warning: method 'handle_topic_info' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static void TopicSubscriber::handle_topic_info(const TPublishTopicRequest& 
topic_request) {
   ```
   



##########
be/src/runtime/task_group/task_group_manager.cpp:
##########
@@ -122,6 +122,56 @@ Status 
TaskGroupManager::create_and_get_task_scheduler(uint64_t tg_id, std::stri
     return Status::OK();
 }
 
+void TaskGroupManager::delete_task_group_by_ids(std::set<uint64_t> id_set) {

Review Comment:
   warning: method 'delete_task_group_by_ids' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static void TaskGroupManager::delete_task_group_by_ids(std::set<uint64_t> 
id_set) {
   ```
   



##########
be/src/agent/topic_subscriber.h:
##########
@@ -17,7 +17,7 @@
 
 #pragma once
 
-#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/BackendService_types.h>

Review Comment:
   warning: 'gen_cpp/BackendService_types.h' file not found 
[clang-diagnostic-error]
   ```cpp
   #include <gen_cpp/BackendService_types.h>
            ^
   ```
   



##########
be/src/agent/topic_listener.h:
##########
@@ -17,19 +17,14 @@
 
 #pragma once
 
-#include <gen_cpp/AgentService_types.h>
+#include <gen_cpp/BackendService_types.h>

Review Comment:
   warning: 'gen_cpp/BackendService_types.h' file not found 
[clang-diagnostic-error]
   ```cpp
   #include <gen_cpp/BackendService_types.h>
            ^
   ```
   



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