private boolean innAddOrUpdTopicCtrlConf(boolean chkConsistent, boolean isAddOpOrOnlyAdd,
            TopicCtrlEntity entity, StringBuilder strBuff,
            ProcessResult result) {
        Integer lid = null;
        TopicCtrlEntity curEntity;
        TopicCtrlEntity newEntity;
        boolean addRecord = true;
        String printPrefix = "[addTopicCtrlConf], ";
        // execute add or update operation
        try {
            // lock brokerId meta-lock
            lid = metaRowLock.getLock(null,
                    StringUtils.getBytesUtf8(entity.getTopicName()), true);
            // get current record and judge execute condition
            curEntity = topicCtrlMapper.getTopicCtrlConf(entity.getTopicName());
            if (curEntity == null) {
                if (chkConsistent && !isAddOpOrOnlyAdd) {
                    result.setFailResult(DataOpErrCode.DERR_NOT_EXIST.getCode(),
                            strBuff.append("Not found topic control configure for topicName(")
                                    .append(entity.getTopicName()).append(")!").toString());
                    strBuff.delete(0, strBuff.length());
                    return result.isSuccess();
                }
                entity.fillEmptyValues(getClusterDefSetting(false));
                topicCtrlMapper.addTopicCtrlConf(entity, strBuff, result);
            } else {
                if (isAddOpOrOnlyAdd) {
                    if (chkConsistent) {
                        result.setFailResult(DataOpErrCode.DERR_EXISTED.getCode(),
                                strBuff.append("Existed record found for topicName(")
                                        .append(entity.getTopicName()).append(")!").toString());
                        strBuff.delete(0, strBuff.length());
                    } else {
                        result.setSuccResult(null);
                    }
                    return result.isSuccess();
                }
                addRecord = false;
                printPrefix = "[udpTopicCtrlConf], ";
                topicCtrlMapper.updTopicCtrlConf(entity, strBuff, result);
            }
            newEntity = topicCtrlMapper.getTopicCtrlConf(entity.getTopicName());
        } catch (Throwable e) {
            return logExceptionInfo(e, printPrefix, strBuff, result);
        } finally {
            if (lid != null) {
                metaRowLock.releaseRowLock(lid);
            }
        }
        // print log to file
        if (result.isSuccess()) {
            if (addRecord) {
                strBuff.append(printPrefix).append(entity.getCreateUser())
                        .append(" added topic control configure: ").append(newEntity);
            } else {
                strBuff.append(printPrefix).append(entity.getModifyUser())
                        .append(" updated topic control configure from ")
                        .append(curEntity).append(" to ").append(newEntity);
            }
            logger.info(strBuff.toString());
            strBuff.delete(0, strBuff.length());
        }
        return result.isSuccess();
    }
Add or Update topic control configure info

@param chkConsistent     whether order operation condition
@param isAddOpOrOnlyAdd  the operation type,
@param entity            the entity need to operation
@param strBuff           the string buffer
@param result            the process result return
@return true if success otherwise false
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/metamanage/metastore/impl/AbsMetaConfigMapperImpl.java