@Override
    public Map<String, Map<Integer, TopicPubStoreInfo>> getTopicPublishInfos(
            Set<String> topicSet) {
        MessageStore store;
        TopicMetadata topicMetadata;
        Set<String> qryTopicSet = new HashSet<>();
        Map<String, Map<Integer, TopicPubStoreInfo>> topicPubStoreInfoMap = new HashMap<>();
        Map<String, TopicMetadata> confTopicInfo = metadataManager.getTopicConfigMap();
        if (topicSet == null || topicSet.isEmpty()) {
            qryTopicSet.addAll(confTopicInfo.keySet());
        } else {
            for (String topic : topicSet) {
                if (confTopicInfo.containsKey(topic)) {
                    qryTopicSet.add(topic);
                }
            }
        }
        if (qryTopicSet.isEmpty()) {
            return topicPubStoreInfoMap;
        }
        Map<Integer, MessageStore> storeMap;
        Map<Integer, TopicPubStoreInfo> storeInfoMap;
        for (String topic : qryTopicSet) {
            topicMetadata = confTopicInfo.get(topic);
            if (topicMetadata == null) {
                continue;
            }
            storeMap = dataStores.get(topic);
            if (storeMap == null) {
                continue;
            }
            storeInfoMap = new HashMap<>();
            for (Map.Entry<Integer, MessageStore> entry : storeMap.entrySet()) {
                if (entry == null
                        || entry.getKey() == null
                        || entry.getValue() == null) {
                    continue;
                }
                store = entry.getValue();
                for (Integer partitionId : topicMetadata.getPartIdsByStoreId(entry.getKey())) {
                    storeInfoMap.put(partitionId, new TopicPubStoreInfo(topic,
                            entry.getKey(), partitionId, store.getIndexMinOffset(),
                            store.getIndexMaxOffset(), store.getDataMinOffset(),
                            store.getDataMaxOffset()));
                }
            }
            topicPubStoreInfoMap.put(topic, storeInfoMap);
        }
        return topicPubStoreInfoMap;
    }
Query topic's publish info.

@param topicSet query's topic set

@return the topic's offset info
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/msgstore/MessageStoreManager.java