private void register2Master() throws Throwable {
        int remainingRetry =
                this.tubeClientConfig.getMaxRegisterRetryTimes();
        StringBuilder sBuilder = new StringBuilder(512);
        do {
            if (isShutdown()) {
                logger.error("Producer service has been shutdown, exit register to master!");
                break;
            }
            remainingRetry--;
            try {
                ClientMaster.RegisterResponseM2P response =
                        this.masterService.producerRegisterP2M(createRegisterRequest(),
                                AddressUtils.getLocalAddress(), tubeClientConfig.isTlsEnable());
                if (response == null) {
                    clientStatsInfo.bookReg2Master(true);
                } else {
                    if (response.getSuccess()) {
                        if (response.getBrokerCheckSum() != this.brokerInfoCheckSum) {
                            updateBrokerInfoList(true, response.getBrokerInfosList(),
                                    response.getBrokerCheckSum(), sBuilder);
                        }
                        clientStatsInfo.bookReg2Master(false);
                        processRegSyncInfo(response);
                        return;
                    } else {
                        clientStatsInfo.bookReg2Master(true);
                    }
                }
                if (remainingRetry <= 0) {
                    if (response == null) {
                        throw new TubeClientException(
                                "Register producer failure, response is null!");
                    } else {
                        throw new TubeClientException(sBuilder
                                .append("Register producer failure, error is ")
                                .append(response.getErrMsg()).toString());
                    }
                }
                Thread.sleep(1000);
            } catch (Throwable e) {
                sBuilder.delete(0, sBuilder.length());
                if (e instanceof LocalConnException) {
                    logger.warn("register2Master error, retry... exception: ", e);
                }
                ThreadUtils.sleep(1200);
                if (remainingRetry <= 0) {
                    throw e;
                }
            }
        } while (true);
    }
Get partitions of the given topic.

@param topic topic name
@return partition map
inlong-tubemq/tubemq-client/src/main/java/org/apache/inlong/tubemq/client/producer/ProducerManager.java