public boolean allowSubscribeTopicForConsumer(final String topic, final String consumerId) {
    if (!consumerIdToConsumerMeta.containsKey(consumerId)) {
      return false;
    }
    final Set<String> subscribedConsumerIdSet = topicNameToSubscribedConsumerIdSet.get(topic);
    if (Objects.isNull(subscribedConsumerIdSet)) {
      return true;
    }
    if (subscribedConsumerIdSet.isEmpty()) {
      return true;
    }
    final String subscribedConsumerId = subscribedConsumerIdSet.iterator().next();
    return Objects.equals(
        Objects.requireNonNull(consumerIdToConsumerMeta.get(subscribedConsumerId)).getUsername(),
        Objects.requireNonNull(consumerIdToConsumerMeta.get(consumerId)).getUsername());
  }
Get the consumers subscribing the given topic in this group.

@param topic The topic name.
@return The set of consumer IDs subscribing the given topic in this group. If no consumer is
    subscribing the topic, return an empty set.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/subscription/meta/consumer/ConsumerGroupMeta.java