private boolean recoveryTopicDeployConfig(StringBuilder strBuff, ProcessResult result) {
        logger.info("[Recovery Topic Deploy] begin ");
        Map<String, TopicDeployEntity> storedTopicDeployMap =
                (Map<String, TopicDeployEntity>) readObjectFromFile(
                        backupAndRecoveryPath, storeFileNameTopicDeploy);
        if (storedTopicDeployMap == null) {
            logger.error(strBuff.append("  read configure file ")
                    .append(backupAndRecoveryPath).append("/")
                    .append(storeFileNameTopicDeploy).append(" failure!").toString());
            strBuff.delete(0, strBuff.length());
            return false;
        }
        logger.info("[Recovery Topic Deploy] upload topic-deploy configurations to master");
        if (!writeTopicDeployInfo(storedTopicDeployMap, strBuff, result)) {
            logger.error(strBuff.append("  write topic-deploy configurations failure!")
                    .append(result.getErrMsg()).toString());
            strBuff.delete(0, strBuff.length());
            return false;
        }
        logger.info("[Recovery Topic Deploy] read topic-deploy configurations from master");
        Map<String, TopicDeployEntity> topicDeployMap = getTopicDeployInfos(strBuff);
        if (topicDeployMap == null) {
            logger.error("  download topic deploy configurations is null!");
            return false;
        }
        logger.info("[Recovery Topic Deploy] verify configurations");
        Set<String> srcTopicSet = new HashSet<>();
        for (TopicDeployEntity entity : storedTopicDeployMap.values()) {
            if (entity.getTopicName().equals(TServerConstants.OFFSET_HISTORY_NAME)) {
                continue;
            }
            srcTopicSet.add(entity.getRecordKey());
        }
        Set<String> tgtTopicSet = new HashSet<>();
        for (TopicDeployEntity entity : topicDeployMap.values()) {
            if (entity.getTopicName().equals(TServerConstants.OFFSET_HISTORY_NAME)) {
                continue;
            }
            tgtTopicSet.add(entity.getRecordKey());
        }
        if (srcTopicSet.size() != tgtTopicSet.size()) {
            logger.error("  verify failure, stored topic-deploy configurations size not equal!");
            return false;
        }
        for (Map.Entry<String, TopicDeployEntity> qryEntry : storedTopicDeployMap.entrySet()) {
            TopicDeployEntity targetEntity = topicDeployMap.get(qryEntry.getKey());
            if (targetEntity == null) {
                logger.error(strBuff
                        .append("  verify failure, stored topic-deploy value not equal!")
                        .append(" data in server is ").append(qryEntry.getValue().toString())
                        .append(", data stored is null!").toString());
                return false;
            }
            if ((targetEntity.getTopicName().equals(TServerConstants.OFFSET_HISTORY_NAME)
                    && (!targetEntity.isMatched(qryEntry.getValue(), false)))
                    || (!targetEntity.getTopicName().equals(TServerConstants.OFFSET_HISTORY_NAME)
                            && !targetEntity.isDataEquals(qryEntry.getValue()))) {
                logger.error(strBuff
                        .append("  verify failure, stored topic-deploy value not equal!")
                        .append(" data in server is ").append(qryEntry.getValue().toString())
                        .append(", data stored is ").append(targetEntity).toString());
                return false;
            }
        }
        logger.info("[Recovery Topic Deploy] end, success!");
        return true;
    }
Recovery topic deploy configurations

@param strBuff  the string buffer
@param result   the process result
@return         true for success, false for failure
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/tools/cli/CliMetaDataBRU.java