levy5307 commented on a change in pull request #605:
URL: https://github.com/apache/incubator-pegasus/pull/605#discussion_r491925878
##########
File path: src/shell/commands/data_operations.cpp
##########
@@ -2664,3 +2665,45 @@ bool calculate_hash_value(command_executor *e,
shell_context *sc, arguments args
tp.output(std::cout);
return true;
}
+
+// TODO: (Tangyanzhao) merge
hotspot_partition_calculator::send_hotkey_detect_request
+bool detect_hotkey(command_executor *e, shell_context *sc, arguments args)
+{
+ static struct option long_options[] = {{"partition_num",
required_argument, 0, 'p'},
+ {"hotkey_type", required_argument,
0, 't'},
+ {"action", required_argument, 0,
'a'},
+ {0, 0, 0, 0}};
+
+ std::string hotkey_type, hotkey_action;
+ int32_t partition_num = 0;
Review comment:
uint32_t
##########
File path: src/client_lib/pegasus_client_impl.cpp
##########
@@ -1302,5 +1303,61 @@ const char *pegasus_client_impl::get_error_string(int
error_code) const
{
return (rocskdb_error == 0) ? 0 : ROCSKDB_ERROR_START - rocskdb_error;
}
+
+bool pegasus_client_impl::detect_hotkey(const std::string &hotkey_type,
+ const std::string &hotkey_action,
+ uint64_t partition_hash,
+ std::string &err_info)
+{
+ if (partition_hash < 0) {
+ err_info = "error partition_num";
+ return false;
+ }
+
+ dsn::apps::hotkey_detect_request req;
+ std::string hotkey_type_check = hotkey_type;
+ std::transform(
+ hotkey_type_check.begin(), hotkey_type_check.end(),
hotkey_type_check.begin(), ::tolower);
Review comment:
remove the prefix `::`
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]