public void adminGetMsgStoreStatsInfo(HttpServletRequest req,
            StringBuilder sBuffer) {
        ProcessResult result = new ProcessResult();
        if (!WebParameterUtils.getStringParamValue(req,
                WebFieldDef.COMPSTOPICNAME, false, null, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return;
        }
        Set<String> topicNameSet = (Set<String>) result.getRetData();
        if (!WebParameterUtils.getBooleanParamValue(req,
                WebFieldDef.NEEDREFRESH, false, false, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return;
        }
        boolean needRefresh = (boolean) result.getRetData();
        // query data
        int index = 0;
        int recordId = 0;
        WebParameterUtils.buildSuccessWithDataRetBegin(sBuffer);
        Map<String, ConcurrentHashMap<Integer, MessageStore>> messageTopicStores =
                broker.getStoreManager().getMessageStores();
        if (topicNameSet.isEmpty()) {
            // get all the msg store statistical data
            for (Map.Entry<String, ConcurrentHashMap<Integer, MessageStore>> entry : messageTopicStores.entrySet()) {
                if (entry == null) {
                    continue;
                }
                String topicName = entry.getKey();
                if (recordId++ > 0) {
                    sBuffer.append(",");
                }
                index = 0;
                sBuffer.append("{\"topicName\":\"").append(topicName).append("\",\"details\":[");
                ConcurrentHashMap<Integer, MessageStore> partStoreMap = entry.getValue();
                if (partStoreMap != null) {
                    for (Entry<Integer, MessageStore> subEntry : partStoreMap.entrySet()) {
                        MessageStore msgStore = subEntry.getValue();
                        if (msgStore == null) {
                            continue;
                        }
                        if (index++ > 0) {
                            sBuffer.append(",");
                        }
                        sBuffer.append("{\"storeId\":").append(subEntry.getKey())
                                .append(",\"msgStore\":");
                        msgStore.getMsgStoreStatsInfo(needRefresh, sBuffer);
                        sBuffer.append("}");
                    }
                }
                sBuffer.append("]}");
            }
        } else {
            ConcurrentHashMap<Integer, MessageStore> msgStoreMap;
            // extract statistical item based on the specified topic
            for (String topicName : topicNameSet) {
                if (recordId++ > 0) {
                    sBuffer.append(",");
                }
                index = 0;
                msgStoreMap = messageTopicStores.get(topicName);
                sBuffer.append("{\"topicName\":\"").append(topicName).append("\",\"details\":[");
                if (msgStoreMap != null) {
                    for (Entry<Integer, MessageStore> subEntry : msgStoreMap.entrySet()) {
                        MessageStore msgStore = subEntry.getValue();
                        if (msgStore == null) {
                            continue;
                        }
                        if (index++ > 0) {
                            sBuffer.append(",");
                        }
                        sBuffer.append("{\"storeId\":").append(subEntry.getKey())
                                .append(",\"msgStore\":");
                        msgStore.getMsgStoreStatsInfo(needRefresh, sBuffer);
                        sBuffer.append("}");
                    }
                }
                sBuffer.append("]}");
            }
        }
        WebParameterUtils.buildSuccessWithDataRetEnd(sBuffer, recordId);
    }
Get message store statistics.

@param req      request
@param sBuffer  process result
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/web/BrokerAdminServlet.java