jhutchison commented on a change in pull request #6493:
URL: https://github.com/apache/geode/pull/6493#discussion_r635358200



##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/pubsub/Subscriptions.java
##########
@@ -67,6 +67,34 @@ boolean exists(Object channelOrPattern, Client client) {
         .collect(Collectors.toList());
   }
 
+  public List<byte[]> findChannelNames() {
+
+    return findChannels()
+        .stream()
+        .map(subscription -> (ChannelSubscription) subscription)
+        .map(ChannelSubscription::getSubscriptionName)
+        .distinct()
+        .collect(Collectors.toList());
+  }
+
+  public List<byte[]> findChannelNames(byte[] pattern) {
+    GlobPattern globPattern = new GlobPattern(new String(pattern));
+
+    return findChannels()
+        .stream()
+        .map(subscription -> (ChannelSubscription) subscription)
+        .filter(subscription -> globPattern.matches(new 
String(subscription.getSubscriptionName())))

Review comment:
       thanks




-- 
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:
us...@infra.apache.org


Reply via email to