ltagliamonte-dd commented on code in PR #2845:
URL: https://github.com/apache/kvrocks/pull/2845#discussion_r2044409107
##########
src/commands/cmd_server.cc:
##########
@@ -1370,6 +1370,49 @@ class CommandPollUpdates : public Commander {
Format format_ = Format::Raw;
};
+class CommandSST : public Commander {
+ public:
+ Status Parse(const std::vector<std::string> &args) override {
+ if (args.size() < 3) {
+ return {Status::RedisParseErr, errWrongNumOfArguments};
+ }
+ CommandParser parser(args, 1);
+ std::string cmd = GET_OR_RET(parser.TakeStr());
+ if (!util::EqualICase(cmd, "load")) {
+ return {Status::RedisParseErr, "unknown subcommand:" + args[1]};
+ }
+ folder_ = GET_OR_RET(parser.TakeStr());
+ // Parse optional movefiles flag
+ while (parser.Good()) {
+ if (parser.EatEqICase("movefiles")) {
+ std::string move_files = GET_OR_RET(parser.TakeStr());
+ if (util::EqualICase(move_files, "yes")) {
+ ingest_options_.move_files = true;
+ } else if (util::EqualICase(move_files, "no")) {
+ ingest_options_.move_files = false;
+ } else {
+ return {Status::RedisParseErr, "movefiles value must be 'yes' or
'no'"};
+ }
+ } else {
+ return {Status::RedisParseErr, "unknown option: " +
parser.TakeStr().GetValue()};
+ }
+ }
+ return Commander::Parse(args);
+ }
+
+ Status Execute([[maybe_unused]] engine::Context &ctx, Server *srv,
[[maybe_unused]] Connection *conn,
+ std::string *output) override {
Review Comment:
@git-hulk how to check `The instance has any replicas or is in replica
mode.`?
--
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]