private StringBuilder innAddOrUpdBrokerConfInfo(HttpServletRequest req,
            StringBuilder sBuffer,
            ProcessResult result,
            boolean isAddOp) {
        // check and get operation info
        if (!WebParameterUtils.getAUDBaseInfo(req, isAddOp, null, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        BaseEntity opEntity = (BaseEntity) result.getRetData();
        // check and get cluster default setting info
        ClusterSettingEntity defClusterSetting =
                defMetaDataService.getClusterDefSetting(false);
        // get brokerPort field
        if (!WebParameterUtils.getIntParamValue(req, WebFieldDef.BROKERPORT,
                false, (isAddOp ? defClusterSetting.getBrokerPort()
                        : TBaseConstants.META_VALUE_UNDEFINED),
                1, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        int brokerPort = (int) result.getRetData();
        // get brokerTlsPort field
        if (!WebParameterUtils.getIntParamValue(req, WebFieldDef.BROKERTLSPORT,
                false, (isAddOp ? defClusterSetting.getBrokerTLSPort()
                        : TBaseConstants.META_VALUE_UNDEFINED),
                1, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        int brokerTlsPort = (int) result.getRetData();
        // get brokerWebPort field
        if (!WebParameterUtils.getIntParamValue(req, WebFieldDef.BROKERWEBPORT,
                false, (isAddOp ? defClusterSetting.getBrokerWebPort()
                        : TBaseConstants.META_VALUE_UNDEFINED),
                1, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        int brokerWebPort = (int) result.getRetData();
        // get regionId field
        if (!WebParameterUtils.getIntParamValue(req, WebFieldDef.REGIONID,
                false, (isAddOp ? TServerConstants.BROKER_REGION_ID_DEF
                        : TBaseConstants.META_VALUE_UNDEFINED),
                TServerConstants.BROKER_REGION_ID_MIN, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        int regionId = (int) result.getRetData();
        // get groupId field
        if (!WebParameterUtils.getIntParamValue(req, WebFieldDef.GROUPID,
                false, (isAddOp ? TServerConstants.BROKER_GROUP_ID_DEF
                        : TBaseConstants.META_VALUE_UNDEFINED),
                TServerConstants.BROKER_GROUP_ID_MIN, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        int groupId = (int) result.getRetData();
        // get and valid TopicPropGroup info
        if (!WebParameterUtils.getTopicPropInfo(req,
                (isAddOp ? defClusterSetting.getClsDefTopicProps() : null), sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        TopicPropGroup brokerProps = (TopicPropGroup) result.getRetData();
        // get and valid broker manage status info
        if (!getManageStatusParamValue(req, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        ManageStatus mngStatus = (ManageStatus) result.getRetData();
        // add record and process result
        List<BrokerProcessResult> retInfo = new ArrayList<>();
        if (isAddOp) {
            // get brokerIp and brokerId field
            if (!getBrokerIpAndIdParamValue(req, sBuffer, result)) {
                WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
                return sBuffer;
            }
            Tuple2<Integer, String> brokerIdAndIpTuple =
                    (Tuple2<Integer, String>) result.getRetData();
            // set the initial status
            if (mngStatus == ManageStatus.STATUS_MANAGE_UNDEFINED) {
                mngStatus = ManageStatus.STATUS_MANAGE_APPLY;
            }
            retInfo.add(defMetaDataService.addOrUpdBrokerConfig(isAddOp, opEntity,
                    brokerIdAndIpTuple.getF0(), brokerIdAndIpTuple.getF1(), brokerPort,
                    brokerTlsPort, brokerWebPort, regionId, groupId,
                    mngStatus, brokerProps, sBuffer, result));
        } else {
            // check and get brokerId field
            if (!WebParameterUtils.getIntParamValue(req,
                    WebFieldDef.COMPSBROKERID, true, sBuffer, result)) {
                WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
                return sBuffer;
            }
            Set<Integer> brokerIdSet = (Set<Integer>) result.getRetData();
            for (Integer brokerId : brokerIdSet) {
                retInfo.add(defMetaDataService.addOrUpdBrokerConfig(isAddOp, opEntity,
                        brokerId, "", brokerPort, brokerTlsPort, brokerWebPort,
                        regionId, groupId, mngStatus, brokerProps, sBuffer, result));
            }
        }
        return buildRetInfo(retInfo, 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