acelyc111 commented on a change in pull request #601:
URL: https://github.com/apache/incubator-pegasus/pull/601#discussion_r487638889



##########
File path: src/server/hotspot_partition_calculator.cpp
##########
@@ -98,5 +103,49 @@ void hotspot_partition_calculator::data_analyse()
     }
 }
 
+/*static*/ void hotspot_partition_calculator::server_hotkey_detect_send(
+    const std::string &app_name,
+    const int partition_index,
+    const hotkey_detect_type write_hotkey_detect,
+    const hotkey_detect_action stop_detect_hotkey)
+{
+    ::dsn::apps::hotkey_detect_request req;
+    req.type = write_hotkey_detect ? dsn::apps::hotkey_type::WRITE : 
dsn::apps::hotkey_type::READ;
+    req.operation = stop_detect_hotkey ? dsn::apps::hotkey_detect_action::STOP
+                                       : 
dsn::apps::hotkey_detect_action::START;
+    derror_f("{} {} hotkey detection",
+             stop_detect_hotkey ? "Stop" : "Start",
+             write_hotkey_detect ? "write" : "read");
+    dsn::rpc_address meta_server;
+    meta_server.assign_group("meta-servers");
+    std::vector<dsn::rpc_address> meta_servers;
+    replica_helper::load_meta_servers(meta_servers);
+    for (auto &address : meta_servers) {
+        meta_server.group_address()->add(address);
+    }
+    auto cluster_name = dsn::replication::get_current_cluster_name();
+    auto resolver = partition_resolver::get_resolver(cluster_name, 
meta_servers, app_name.c_str());
+    resolver->call_op(RPC_DETECT_HOTKEY,
+                      req,
+                      nullptr,
+                      [app_name, partition_index](
+                          dsn::error_code err, dsn::message_ex *request, 
dsn::message_ex *resp) {

Review comment:
       Variable names in the same level should keep in the same style, that is 
to say, simplify both of them or both not.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pegasus.apache.org
For additional commands, e-mail: dev-h...@pegasus.apache.org

Reply via email to