git-hulk commented on code in PR #3022:
URL: https://github.com/apache/kvrocks/pull/3022#discussion_r2140358154


##########
src/commands/cmd_server.cc:
##########
@@ -1493,6 +1493,41 @@ class CommandSST : public Commander {
   rocksdb::IngestExternalFileOptions ingest_options_;
 };
 
+// command format: flushmemtable [async]
+class CommandFlushMemTable : public Commander {
+ public:
+  Status Parse([[maybe_unused]] const std::vector<std::string> &args) override 
{
+    if (args.size() > 2) {
+      return {Status::RedisParseErr, errWrongNumOfArguments};
+    }
+
+    if (args.size() == 1) {
+      flush_options_.wait = true;
+      return Status::OK();
+    }
+
+    if (!util::EqualICase(args[1], "async")) {
+      return {Status::RedisParseErr, "Parameter must be 'async', got " + 
args[1]};
+    }
+
+    flush_options_.wait = false;

Review Comment:
   ```suggestion
   
       flush_options_.wait = true;
       if (args.size() > 1) {
         if (util::EqualICase(args[1], "sync") || util::EqualICase(args[1], 
"async")) {
           flush_options_.wait = util::EqualICase(args[1], "sync");
         } else {
           return {Status::RedisParseErr, "parameter must be 'sync' or 
'async'"};
         }
       }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to