private List<SubscriptionMeta> getAllSubscriptionMetaInternal(
      @Nullable Predicate<TopicMeta> predicate) {
    List<SubscriptionMeta> allSubscriptions = new ArrayList<>();
    for (TopicMeta topicMeta : topicMetaKeeper.getAllTopicMeta()) {
      if (Objects.nonNull(predicate) && !predicate.test(topicMeta)) {
        continue;
      }
      for (String consumerGroupId :
          consumerGroupMetaKeeper.getSubscribedConsumerGroupIds(topicMeta.getTopicName())) {
        Set<String> subscribedConsumerIDs =
            consumerGroupMetaKeeper.getConsumersSubscribingTopic(
                consumerGroupId, topicMeta.getTopicName());
        Optional<Long> creationTime =
            consumerGroupMetaKeeper.getSubscriptionCreationTime(
                consumerGroupId, topicMeta.getTopicName());
        if (!subscribedConsumerIDs.isEmpty()) {
          allSubscriptions.add(
              new SubscriptionMeta(
                  topicMeta, consumerGroupId, subscribedConsumerIDs, creationTime.orElse(null)));
        }
      }
    }
    return allSubscriptions;
  }
Caller should ensure that the method is called in the lock {@link #acquireWriteLock}.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/subscription/SubscriptionInfo.java