torwig commented on code in PR #1444:
URL:
https://github.com/apache/incubator-kvrocks/pull/1444#discussion_r1198084312
##########
src/commands/cmd_set.cc:
##########
@@ -283,6 +285,46 @@ class CommandSInter : public Commander {
}
};
+class CommandSInterCard : public Commander {
+ public:
+ Status Parse(const std::vector<std::string> &args) override {
+ auto parse_numkey = ParseInt<int>(args[1], 10);
+ if (!parse_numkey) {
+ return {Status::RedisParseErr, errValueNotInteger};
+ }
+ numkeys_ = *parse_numkey;
+
+ // command: SINTERCARD 2 key1 key2 LIMIT 1
+ if (args.size() == numkeys_ + 4) {
+ auto parse_limit = ParseInt<int>(args[numkeys_ + 2], 10);
+ if (!parse_limit) {
+ return {Status::RedisParseErr, errValueNotInteger};
+ }
+ limit_ = std::max(0, *parse_limit);
+ }
+ return Commander::Parse(args);
+ }
+
+ Status Execute(Server *svr, Connection *conn, std::string *output) override {
+ std::vector<Slice> keys;
+ for (size_t i = 2; i < numkeys_ + 2; i++) {
+ keys.emplace_back(args_[i]);
+ }
+
+ redis::Set set_db(svr->storage, conn->GetNamespace());
+ int ret = 0;
Review Comment:
You can just use `Do()` function of the client to send raw request instead
of the command, for example:
https://github.com/apache/incubator-kvrocks/blob/unstable/tests/gocase/unit/type/stream/stream_test.go#L45.
Or update the package.
--
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]