sabbey37 commented on a change in pull request #5749:
URL: https://github.com/apache/geode/pull/5749#discussion_r524442295



##########
File path: 
geode-redis/src/main/java/org/apache/geode/redis/internal/executor/server/SlowlogExecutor.java
##########
@@ -30,7 +27,21 @@
   @Override
   public RedisResponse executeCommand(Command command,
       ExecutionHandlerContext context) {
-    List<ByteArrayWrapper> values = new ArrayList<ByteArrayWrapper>();
-    return RedisResponse.array(values);
+    String subCommand = command.getStringKey();
+    if (subCommand.toLowerCase().equals("get")) {
+      return RedisResponse.emptyArray();
+    } else if (subCommand.toLowerCase().equals("len")) {
+      return RedisResponse.integer(0);
+    } else if (subCommand.toLowerCase().equals("reset")) {
+      return RedisResponse.ok();
+    }
+    throw new 
RedisParametersMismatchException(wrongNumberOfArgumentsErrorMessage());
+  }
+
+  public String wrongNumberOfArgumentsErrorMessage() {
+    String result;
+    result = String
+        .format("Unknown subcommand or wrong number of arguments for 'len'. 
Try SLOWLOG HELP.");
+    return result;

Review comment:
       It seems kind of weird that we have this hard coded to `len`... right 
now if I type in `slowlog sjls`, I get `ERR Unknown subcommand or wrong number 
of arguments for 'len'. Try SLOWLOG HELP.` instead of `ERR Unknown subcommand 
or wrong number of arguments for 'sjls'. Try SLOWLOG HELP.` It also might be 
good to add this Error to the `RedisConstants` class.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to