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



##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/pubsub/Subscriptions.java
##########
@@ -96,104 +66,84 @@ boolean exists(Object channelOrPattern, Client client) {
    * @param pattern the glob pattern to search for
    */
   public List<byte[]> findChannelNames(byte[] pattern) {
-
-    GlobPattern globPattern = new GlobPattern(bytesToString(pattern));
-
-    return findChannelNames()
-        .stream()
-        .filter(name -> globPattern.matches(bytesToString(name)))
-        .collect(Collectors.toList());
+    return channelSubscriptions.getIds(pattern);
   }
 
   /**
-   * Return a list consisting of pairs {@code channelName, subscriptionCount}.
-   *
-   * @param names a list of the names to consider. This should not include any 
patterns.
+   * Return a count of all pattern subscriptions including duplicates.
    */
-  public List<Object> findNumberOfSubscribersPerChannel(List<byte[]> names) {
-    List<Object> result = new ArrayList<>();
-
-    names.forEach(name -> {
-      Long subscriptionCount = findSubscriptions(name)
-          .stream()
-          .filter(subscription -> subscription instanceof ChannelSubscription)
-          .count();
-
-      result.add(name);
-      result.add(subscriptionCount);
-    });
+  public int getPatternSubscriptionCount() {

Review comment:
       yes




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