public StringBuilder adminQueryBrokerRunStatusInfo(HttpServletRequest req,
            StringBuilder sBuffer,
            ProcessResult result) {
        BrokerConfEntity qryEntity = new BrokerConfEntity();
        // get queried operation info, for createUser, modifyUser, dataVersionId
        if (!WebParameterUtils.getQueriedOperateInfo(req, qryEntity, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        // check and get brokerId field
        if (!WebParameterUtils.getIntParamValue(req,
                WebFieldDef.COMPSBROKERID, false, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        final Set<Integer> brokerIds = (Set<Integer>) result.getRetData();
        // get brokerIp info
        if (!WebParameterUtils.getStringParamValue(req,
                WebFieldDef.COMPBROKERIP, false, null, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        final Set<String> brokerIpSet = (Set<String>) result.getRetData();
        // get withDetail info
        if (!WebParameterUtils.getBooleanParamValue(req,
                WebFieldDef.WITHDETAIL, false, false, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        boolean withDetail = (Boolean) result.getRetData();
        // get onlyAbnormal info
        if (!WebParameterUtils.getBooleanParamValue(req,
                WebFieldDef.ONLYABNORMAL, false, false, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        boolean onlyAbnormal = (Boolean) result.getRetData();
        // get onlyAutoForbidden info
        if (!WebParameterUtils.getBooleanParamValue(req,
                WebFieldDef.ONLYAUTOFBD, false, false, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        boolean onlyAutoForbidden = (Boolean) result.getRetData();
        // get onlyEnableTLS info
        if (!WebParameterUtils.getBooleanParamValue(req,
                WebFieldDef.ONLYENABLETLS, false, false, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        boolean onlyEnableTLS = (Boolean) result.getRetData();
        // query current broker configures
        Map<Integer, BrokerConfEntity> brokerConfEntityMap =
                defMetaDataService.getBrokerConfInfo(brokerIds, brokerIpSet, null);
        BrokerAbnHolder abnHolder = master.getBrokerAbnHolder();
        BrokerRunManager brokerRunManager = master.getBrokerRunManager();
        Map<Integer, BrokerAbnHolder.BrokerAbnInfo> brokerAbnInfoMap =
                abnHolder.getBrokerAbnormalMap();
        Map<Integer, BrokerAbnHolder.BrokerFbdInfo> brokerFbdInfoMap =
                abnHolder.getAutoForbiddenBrokerMapInfo();
        int totalCnt = 0;
        WebParameterUtils.buildSuccessWithDataRetBegin(sBuffer);
        for (BrokerConfEntity entity : brokerConfEntityMap.values()) {
            BrokerAbnHolder.BrokerAbnInfo brokerAbnInfo =
                    brokerAbnInfoMap.get(entity.getBrokerId());
            if (onlyAbnormal && brokerAbnInfo == null) {
                continue;
            }
            BrokerAbnHolder.BrokerFbdInfo brokerForbInfo =
                    brokerFbdInfoMap.get(entity.getBrokerId());
            if (onlyAutoForbidden && brokerForbInfo == null) {
                continue;
            }
            BrokerInfo brokerInfo = brokerRunManager.getBrokerInfo(entity.getBrokerId());
            if (onlyEnableTLS && (brokerInfo == null || !brokerInfo.isEnableTLS())) {
                continue;
            }
            if (totalCnt++ > 0) {
                sBuffer.append(",");
            }
            sBuffer.append("{\"brokerId\":").append(entity.getBrokerId())
                    .append(",\"brokerIp\":\"").append(entity.getBrokerIp())
                    .append("\",\"brokerPort\":").append(entity.getBrokerPort())
                    .append(",\"brokerWebPort\":").append(entity.getBrokerWebPort())
                    .append(",\"manageStatus\":\"").append(entity.getManageStatusStr()).append("\"");
            if (brokerInfo == null) {
                sBuffer.append(",\"brokerTLSPort\":").append(entity.getBrokerTLSPort())
                        .append(",\"enableTLS\":\"-\"");
            } else {
                sBuffer.append(",\"brokerTLSPort\":").append(entity.getBrokerTLSPort())
                        .append(",\"enableTLS\":").append(brokerInfo.isEnableTLS());
            }
            if (brokerAbnInfo == null) {
                sBuffer.append(",\"isRepAbnormal\":false");
            } else {
                sBuffer.append(",\"isRepAbnormal\":true,\"repStatus\":")
                        .append(brokerAbnInfo.getAbnStatus());
            }
            if (brokerForbInfo == null) {
                sBuffer.append(",\"isAutoForbidden\":false");
            } else {
                sBuffer.append(",\"isAutoForbidden\":true");
            }
            if (entity.getManageStatus() == ManageStatus.STATUS_MANAGE_APPLY) {
                sBuffer.append(",\"runStatus\":\"-\",\"subStatus\":\"-\"")
                        .append(",\"isConfChanged\":\"-\",\"isConfLoaded\":\"-\",\"isBrokerOnline\":\"-\"")
                        .append(",\"brokerVersion\":\"-\",\"acceptPublish\":\"-\",\"acceptSubscribe\":\"-\"");
            } else {
                Tuple2<Boolean, Boolean> pubSubTuple =
                        entity.getManageStatus().getPubSubStatus();
                BrokerRunStatusInfo runStatusInfo =
                        brokerRunManager.getBrokerRunStatusInfo(entity.getBrokerId());
                if (runStatusInfo == null) {
                    sBuffer.append(",\"runStatus\":\"unRegister\",\"subStatus\":\"-\"")
                            .append(",\"isConfChanged\":\"-\",\"isConfLoaded\":\"-\",\"isBrokerOnline\":\"-\"")
                            .append(",\"brokerVersion\":\"-\",\"acceptPublish\":\"-\",\"acceptSubscribe\":\"-\"");
                } else {
                    StepStatus stepStatus = runStatusInfo.getCurStepStatus();
                    if (runStatusInfo.isOnline()) {
                        if (stepStatus == StepStatus.STEP_STATUS_UNDEFINED) {
                            sBuffer.append(",\"runStatus\":\"running\",\"subStatus\":\"idle\"");
                        } else {
                            sBuffer.append(",\"runStatus\":\"running\"")
                                    .append(",\"subStatus\":\"processing_event\",\"stepOp\":")
                                    .append(stepStatus.getCode());
                        }
                    } else {
                        if (stepStatus == StepStatus.STEP_STATUS_UNDEFINED) {
                            sBuffer.append(",\"runStatus\":\"notRegister\",\"subStatus\":\"idle\"");
                        } else {
                            sBuffer.append(",\"runStatus\":\"notRegister\"")
                                    .append(",\"subStatus\":\"processing_event\",\"stepOp\":")
                                    .append(stepStatus.getCode());
                        }
                    }
                    Tuple2<Boolean, Boolean> syncTuple =
                            runStatusInfo.getDataSyncStatus();
                    sBuffer.append(",\"isConfChanged\":\"").append(syncTuple.getF0())
                            .append("\",\"isConfLoaded\":\"").append(syncTuple.getF1())
                            .append("\",\"isBrokerOnline\":\"").append(runStatusInfo.isOnline())
                            .append("\"").append(",\"brokerVersion\":\"-\",\"acceptPublish\":\"")
                            .append(pubSubTuple.getF0()).append("\",\"acceptSubscribe\":\"")
                            .append(pubSubTuple.getF1()).append("\"");
                    if (withDetail) {
                        sBuffer = runStatusInfo.toJsonString(sBuffer.append(","));
                    }
                }
            }
            sBuffer.append("}");
        }
        WebParameterUtils.buildSuccessWithDataRetEnd(sBuffer, totalCnt);
        return sBuffer;
    }
Query run status of broker

@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/WebBrokerConfHandler.java