PragmaTwice commented on code in PR #3022:
URL: https://github.com/apache/kvrocks/pull/3022#discussion_r2139096598


##########
src/commands/cmd_server.cc:
##########
@@ -1493,6 +1493,38 @@ class CommandSST : public Commander {
   rocksdb::IngestExternalFileOptions ingest_options_;
 };
 
+// command format: flushmemtables [sync|async]
+class CommandFlushMemTables : public Commander {
+ public:
+  Status Parse([[maybe_unused]] const std::vector<std::string> &args) override 
{
+    CommandParser parser(args, 1);
+
+    const std::string param = GET_OR_RET(parser.TakeStr());
+    if (util::EqualICase(param, "sync")) {
+      flush_options_.wait = true;
+    } else if (util::EqualICase(param, "async")) {
+      flush_options_.wait = false;
+    } else {
+      return {Status::RedisParseErr, "Parameter must be 'sync' or 'async', got 
" + param};
+    }

Review Comment:
   I think we can have a default behavior `sync`, so it can be `kflush` or 
`kflush async`, where `sync` is omitted.



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