DonalEvans commented on a change in pull request #6814:
URL: https://github.com/apache/geode/pull/6814#discussion_r703777480



##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/executor/pubsub/UnsubscribeExecutor.java
##########
@@ -15,60 +15,56 @@
 
 package org.apache.geode.redis.internal.executor.pubsub;
 
-import static org.apache.geode.redis.internal.pubsub.Subscription.Type.CHANNEL;
+import static java.util.Collections.singletonList;
+import static 
org.apache.geode.redis.internal.netty.StringBytesGlossary.bUNSUBSCRIBE;
 
 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.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 UnsubscribeExecutor extends AbstractExecutor {
 
   @Override
   public RedisResponse executeCommand(Command command, ExecutionHandlerContext 
context) {
-
     List<byte[]> channelNames = extractChannelNames(command);
-    if (channelNames.isEmpty()) {
-      channelNames = 
context.getPubSub().findSubscriptionNames(context.getClient(), CHANNEL);
-    }
-
     Collection<Collection<?>> response = unsubscribe(context, channelNames);
-
     return RedisResponse.flattenedArray(response);
   }
 
   private List<byte[]> extractChannelNames(Command command) {

Review comment:
       That sounds ideal, yeah




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