public StringBuilder adminQueryBrokerTopicCfgAndRunInfo(HttpServletRequest req,
            StringBuilder sBuffer,
            ProcessResult result) {
        if (!WebParameterUtils.getStringParamValue(req,
                WebFieldDef.COMPSTOPICNAME, false, null, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        Set<String> topicNameSet = (Set<String>) result.getRetData();
        // check and get brokerId field
        if (!WebParameterUtils.getIntParamValue(req,
                WebFieldDef.COMPSBROKERID, false, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        Set<Integer> brokerIdSet = (Set<Integer>) result.getRetData();
        Map<Integer, List<TopicDeployEntity>> queryResult =
                defMetaDataService.getTopicDeployInfoMap(topicNameSet, brokerIdSet);
        // build query result
        int recordCount = 0;
        int topicTotalCfgCnt = 0;
        int storeTotalCfgCnt = 0;
        int partTotalCfgCnt = 0;
        int topicAccPubTotalCnt = 0;
        int topicAccSubTotalCnt = 0;
        int storeAccPubTotalCnt = 0;
        int storeAccSubTotalCnt = 0;
        int partAccPubTotalCnt = 0;
        int partAccSubTotalCnt = 0;
        int tmpPartTtlCount = 0;
        String strManageStatus;
        BrokerRunStatusInfo runStatusInfo;
        List<TopicDeployEntity> topicDeployInfo;
        Tuple2<Boolean, Boolean> publishTuple = new Tuple2<>();
        BrokerRunManager brokerRunManager = master.getBrokerRunManager();
        WebParameterUtils.buildSuccessWithDataRetBegin(sBuffer);
        for (Map.Entry<Integer, List<TopicDeployEntity>> entry : queryResult.entrySet()) {
            if (entry.getKey() == null || entry.getValue() == null) {
                continue;
            }
            BrokerConfEntity brokerConf =
                    defMetaDataService.getBrokerConfByBrokerId(entry.getKey());
            if (brokerConf == null) {
                continue;
            }
            // build return info item
            if (recordCount++ > 0) {
                sBuffer.append(",");
            }
            // reset data items
            topicTotalCfgCnt = 0;
            storeTotalCfgCnt = 0;
            partTotalCfgCnt = 0;
            topicAccPubTotalCnt = 0;
            topicAccSubTotalCnt = 0;
            storeAccPubTotalCnt = 0;
            storeAccSubTotalCnt = 0;
            partAccPubTotalCnt = 0;
            partAccSubTotalCnt = 0;
            // query detail information
            topicDeployInfo = entry.getValue();
            strManageStatus = brokerConf.getManageStatus().getDescription();
            runStatusInfo = brokerRunManager.getBrokerRunStatusInfo(entry.getKey());
            brokerRunManager.getBrokerPublishStatus(entry.getKey(), publishTuple);
            // accumulate data items
            for (TopicDeployEntity topicEntity : topicDeployInfo) {
                if (topicEntity == null) {
                    continue;
                }
                topicTotalCfgCnt++;
                storeTotalCfgCnt += topicEntity.getNumTopicStores();
                tmpPartTtlCount = topicEntity.getNumTopicStores() * topicEntity.getNumPartitions();
                partTotalCfgCnt += tmpPartTtlCount;
                if (runStatusInfo == null) {
                    continue;
                }
                if (publishTuple.getF0() && topicEntity.isAcceptPublish()) {
                    topicAccPubTotalCnt++;
                    storeAccPubTotalCnt += topicEntity.getNumTopicStores();
                    partAccPubTotalCnt += tmpPartTtlCount;
                }
                if (publishTuple.getF1() && topicEntity.isAcceptSubscribe()) {
                    topicAccSubTotalCnt++;
                    storeAccSubTotalCnt += topicEntity.getNumTopicStores();
                    partAccSubTotalCnt += tmpPartTtlCount;
                }
            }
            // build query record by broker
            sBuffer.append("{\"brokerId\":").append(brokerConf.getBrokerId())
                    .append(",\"brokerIp\":\"").append(brokerConf.getBrokerIp())
                    .append("\",\"brokerPort\":").append(brokerConf.getBrokerPort())
                    .append(",\"manageStatus\":\"").append(strManageStatus)
                    .append("\",\"acceptPublish\":").append(publishTuple.getF0())
                    .append(",\"acceptSubscribe\":").append(publishTuple.getF1());
            if (runStatusInfo == null) {
                sBuffer.append(",\"nodeRunInfo\":\"-\"");

            } else {
                sBuffer.append(",\"nodeRunInfo\":\"running\"");
            }
            sBuffer.append(",\"topicTotalCfgCnt\":").append(topicTotalCfgCnt)
                    .append(",\"storeTotalCfgCnt\":").append(storeTotalCfgCnt)
                    .append(",\"partTotalCfgCnt\":").append(partTotalCfgCnt)
                    .append(",\"topicAccPubTotalCnt\":").append(topicAccPubTotalCnt)
                    .append(",\"topicAccSubTotalCnt\":").append(topicAccSubTotalCnt)
                    .append(",\"storeAccPubTotalCnt\":").append(storeAccPubTotalCnt)
                    .append(",\"storeAccSubTotalCnt\":").append(storeAccSubTotalCnt)
                    .append(",\"partAccPubTotalCnt\":").append(partAccPubTotalCnt)
                    .append(",\"partAccSubTotalCnt\":").append(partAccSubTotalCnt)
                    .append("}");
        }
        WebParameterUtils.buildSuccessWithDataRetEnd(sBuffer, recordCount);
        return sBuffer;
    }
Query broker's topic configure view

@param req       Http Servlet Request
@param sBuffer   string buffer
@param result    process result
@return    process result
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/web/handler/WebTopicDeployHandler.java