dschneider-pivotal commented on a change in pull request #6814:
URL: https://github.com/apache/geode/pull/6814#discussion_r703716057



##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/executor/pubsub/PunsubscribeExecutor.java
##########
@@ -16,61 +16,56 @@
 
 package org.apache.geode.redis.internal.executor.pubsub;
 
-import static org.apache.geode.redis.internal.netty.Coder.bytesToString;
-import static org.apache.geode.redis.internal.pubsub.Subscription.Type.PATTERN;
+import static java.util.Collections.singletonList;
+import static 
org.apache.geode.redis.internal.netty.StringBytesGlossary.bPUNSUBSCRIBE;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import java.util.stream.Collectors;
 
 import org.apache.geode.redis.internal.executor.AbstractExecutor;
-import org.apache.geode.redis.internal.executor.GlobPattern;
 import org.apache.geode.redis.internal.executor.RedisResponse;
+import org.apache.geode.redis.internal.netty.Client;
 import org.apache.geode.redis.internal.netty.Command;
 import org.apache.geode.redis.internal.netty.ExecutionHandlerContext;
 
 public class PunsubscribeExecutor extends AbstractExecutor {
 
   @Override
   public RedisResponse executeCommand(Command command, ExecutionHandlerContext 
context) {
-
     List<byte[]> patternNames = extractPatternNames(command);
-    if (patternNames.isEmpty()) {
-      patternNames = 
context.getPubSub().findSubscriptionNames(context.getClient(), PATTERN);
-    }
-
     Collection<Collection<?>> response = punsubscribe(context, patternNames);
-
     return RedisResponse.flattenedArray(response);
   }
 
   private List<byte[]> extractPatternNames(Command command) {
     return 
command.getProcessedCommand().stream().skip(1).collect(Collectors.toList());
   }
 
+  private static final Collection<Collection<?>> EMPTY_RESULT = 
singletonList(createItem(null, 0));

Review comment:
       yes, and it has been moved to the Subscriptions 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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to