Shuo-Jia commented on a change in pull request #605:
URL: https://github.com/apache/incubator-pegasus/pull/605#discussion_r492444592



##########
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;
+    optind = 0;
+    while (true) {
+        int option_index = 0;
+        int c;
+        c = getopt_long(args.argc, args.argv, "a:p:t:c", long_options, 
&option_index);
+        if (c == -1)
+            break;
+        switch (c) {
+        case 'p':
+            partition_num = boost::lexical_cast<int32_t>(optarg);
+            break;
+        case 't':
+            hotkey_type = optarg;
+            break;
+        case 'a':
+            hotkey_action = optarg;

Review comment:
       May just as the @acelyc111 comment: 
https://github.com/apache/incubator-pegasus/pull/605#discussion_r492069310, 
you'd better parse the string to `dsn::apps::hotkey_type::type` and 
`dsn::apps::hotkey_detect_action` here, and then pass `detect_hotkey`




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

Reply via email to