private HeartRequestB2M createBrokerHeartBeatRequest() {
        HeartRequestB2M.Builder builder = HeartRequestB2M.newBuilder();
        builder.setBrokerId(String.valueOf(tubeConfig.getBrokerId()));
        builder.setBrokerOnline(isOnline);
        builder.setReadStatusRpt(ServiceStatusHolder.getReadServiceReportStatus());
        builder.setWriteStatusRpt(ServiceStatusHolder.getWriteServiceReportStatus());
        builder.setCurBrokerConfId(metadataManager.getBrokerMetadataConfId());
        builder.setConfCheckSumId(metadataManager.getBrokerConfCheckSumId());
        FlowCtrlRuleHandler flowCtrlRuleHandler =
                metadataManager.getFlowCtrlRuleHandler();
        builder.setFlowCheckId(flowCtrlRuleHandler.getFlowCtrlId());
        builder.setQryPriorityId(flowCtrlRuleHandler.getQryPriorityId());
        builder.setTakeConfInfo(false);
        builder.setTakeRemovedTopicInfo(false);
        List<String> removedTopics = this.metadataManager.getHardRemovedTopics();
        if (!removedTopics.isEmpty()) {
            builder.setTakeRemovedTopicInfo(true);
            builder.addAllRemovedTopicsInfo(removedTopics);
        }
        ClientMaster.MasterCertificateInfo.Builder authInfoBuilder = genMasterCertificateInfo();
        if (authInfoBuilder != null) {
            builder.setAuthInfo(authInfoBuilder.build());
        }
        builder.setClsConfig(buildClusterConfig());
        if (metadataManager.isBrokerMetadataChanged() || requireReportConf) {
            builder.setTakeConfInfo(true);
            builder.setBrokerDefaultConfInfo(metadataManager.getBrokerDefMetaConfInfo());
            builder.addAllBrokerTopicSetConfInfo(metadataManager.getTopicMetaConfInfoLst());
            logger.info(new StringBuilder(512)
                    .append("[HeartBeat request] current broker report info: brokerConfId=")
                    .append(metadataManager.getBrokerMetadataConfId())
                    .append(",readStatusRpt=").append(builder.getReadStatusRpt())
                    .append(",writeStatusRpt=").append(builder.getWriteStatusRpt())
                    .append(",flowCtrlId=").append(flowCtrlRuleHandler.getFlowCtrlId())
                    .append(",QryPriorityId=").append(flowCtrlRuleHandler.getQryPriorityId())
                    .append(",ReadStatusRpt=").append(builder.getReadStatusRpt())
                    .append(",WriteStatusRpt=").append(builder.getWriteStatusRpt())
                    .append(",lastReportedConfigId=").append(metadataManager.getLastRptBrokerMetaConfId())
                    .append(",configCheckSumId=").append(metadataManager.getBrokerConfCheckSumId())
                    .append(",brokerDefaultConfInfo=").append(metadataManager.getBrokerDefMetaConfInfo())
                    .append(",brokerTopicSetConfList=").append(metadataManager.getTopicMetaConfInfoLst()).toString());
            metadataManager.setLastRptBrokerMetaConfId(metadataManager.getBrokerMetadataConfId());
            requireReportConf = false;
        }
        return builder.build();
    }
Build heartbeat request to master.

@return the HeartRequestB2M request object
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/TubeBroker.java