You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/11/15 14:09:25 UTC

[GitHub] [incubator-kvrocks] git-hulk commented on a diff in pull request #1119: Support more `ZRANGE` options

git-hulk commented on code in PR #1119:
URL: https://github.com/apache/incubator-kvrocks/pull/1119#discussion_r1022831750


##########
src/commands/redis_cmd.cc:
##########
@@ -2554,152 +2556,135 @@ class CommandZPopMax : public CommandZPop {
 class CommandZRange : public Commander {
  public:
   explicit CommandZRange(bool reversed = false) : reversed_(reversed) {}
-
   Status Parse(const std::vector<std::string> &args) override {
-    auto parse_start = ParseInt<int>(args[2], 10);
-    auto parse_stop = ParseInt<int>(args[3], 10);
-    if (!parse_start || !parse_stop) {
-      return Status(Status::RedisParseErr, errValueNotInteger);
+    int offset = 0;
+    int count = -1;
+    CommandParser parser(args, 4);
+    while (parser.Good()) {
+      if (parser.EatEqICaseFlag("BYSCORE", by_flag_)) {
+        spec_ = std::make_shared<ZRangeSpec>();

Review Comment:
   I still can't understand this point, the lookup command is unique ptr and it should not have the race between workers.



##########
src/types/redis_zset.cc:
##########
@@ -224,7 +224,10 @@ rocksdb::Status ZSet::Pop(const Slice &user_key, int count, bool min, std::vecto
 }
 
 rocksdb::Status ZSet::Range(const Slice &user_key, int start, int stop, uint8_t flags,
-                            std::vector<MemberScore> *mscores) {
+                            std::vector<MemberScore> *mscores, int limit_offset, int limit_count) {

Review Comment:
   Can simplify the naming: `limit_offset` => `offset`, same as the `limit_count`



-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org