| 492 | } |
| 493 | |
| 494 | bool RedisClusterChannel::ExecuteMSet(const ParsedCommand& cmd, |
| 495 | butil::IOBuf* encoded_reply, |
| 496 | Controller* cntl) { |
| 497 | if (cmd.args.size() < 3 || ((cmd.args.size() - 1) % 2 != 0)) { |
| 498 | AppendErrorReply(encoded_reply, |
| 499 | "ERR wrong number of arguments for 'mset' command"); |
| 500 | return true; |
| 501 | } |
| 502 | |
| 503 | for (size_t i = 1; i + 1 < cmd.args.size(); i += 2) { |
| 504 | std::vector<std::string> sub_args; |
| 505 | sub_args.push_back("set"); |
| 506 | sub_args.push_back(cmd.args[i]); |
| 507 | sub_args.push_back(cmd.args[i + 1]); |
| 508 | |
| 509 | SingleCommandResult sub_result; |
| 510 | if (!ExecuteSingleCommand(sub_args, NULL, &sub_result, cntl)) { |
| 511 | return false; |
| 512 | } |
| 513 | if (sub_result.is_error || !sub_result.is_status_ok) { |
| 514 | encoded_reply->swap(sub_result.encoded_reply); |
| 515 | return true; |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | AppendStatusReply(encoded_reply, "OK"); |
| 520 | return true; |
| 521 | } |
| 522 | |
| 523 | bool RedisClusterChannel::ExecuteIntegerAggregate(const ParsedCommand& cmd, |
| 524 | butil::IOBuf* encoded_reply, |