@Override
    public TubeMQResult cloneTopicToBrokers(CloneTopicReq req) throws Exception {

        MasterEntry master = masterService.getMasterNode(Long.valueOf(req.getClusterId()));
        if (master == null) {
            return TubeMQResult.errorResult(TubeMQErrorConst.NO_SUCH_CLUSTER);
        }
        // 1 query topic config
        TubeHttpTopicInfoList topicInfoList = topicService.requestTopicConfigInfo(master, req.getSourceTopicName());

        if (topicInfoList == null) {
            return TubeMQResult.errorResult("no such topic");
        }

        // 2 generate add topic req
        AddTopicReq addTopicReq = req.getTargetTopic();

        // 3 send to master
        return addTopicToBrokers(addTopicReq, master);

    }
given one topic, copy its config and clone to brokers
if no broker is is provided, topics will be cloned to all brokers in cluster

@param req
@return

@throws Exception exception
inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/service/NodeServiceImpl.java