@Override
    public boolean start(Map<String, TreeSet<String>> topicAndFilterCondMap,
            int sourceCount, int nodeId,
            ProcessResult result) throws TubeClientException {
        if (result == null) {
            throw new TubeClientException("Illegal parameter: parameter result is null!");
        }
        StringBuilder sBuffer = new StringBuilder(512);
        if (!validAndStoreConsumeTarget(topicAndFilterCondMap, sBuffer, result)) {
            return result.isSuccess();
        }
        if (sourceCount > 0) {
            if (nodeId < 0 || nodeId > (sourceCount - 1)) {
                result.setFailResult(TErrCodeConstants.BAD_REQUEST,
                        "When groupNodeCnt is valid, the nodeId value must be between in [0, sourceCount-1]!");
                return result.isSuccess();
            }
        }
        // judge client status
        if (clientStatus.get() != 0) {
            result.setFailResult(TErrCodeConstants.BAD_REQUEST,
                    "The SDK is running, please shutdown first!");
            return result.isSuccess();
        }
        if (!clientStatus.compareAndSet(0, 1)) {
            switch (clientStatus.get()) {
                case 2: {
                    result.setSuccResult();
                }
                    break;

                case 3: {
                    result.setFailResult(TErrCodeConstants.BAD_REQUEST,
                            "The client is shutting down. Please try again later!");
                }
                    break;

                case 0:
                case 1:
                default: {
                    result.setFailResult(TErrCodeConstants.BAD_REQUEST,
                            "Duplicated calls, the client is starting, please wait a minute!");
                }
            }
            return result.isSuccess();
        }
        if (sourceCount > 0) {
            this.sourceCount = sourceCount;
            this.nodeId = nodeId;
        }
        // store consume target information
        Map<String, TreeSet<String>> consumeTargetMap =
                (Map<String, TreeSet<String>>) result.getRetData();
        this.consumeSubInfo.storeConsumeTarget(consumeTargetMap);
        if (!startMasterAndBrokerThreads(result, sBuffer)) {
            clientStatus.compareAndSet(1, 0);
            return result.isSuccess();
        }
        clientStatus.compareAndSet(1, 2);
        result.setSuccResult();
        return result.isSuccess();
    }
Initial a client-balance consumer object
@param messageSessionFactory   the session factory
@param consumerConfig          the consumer configure
@throws TubeClientException    the exception while creating object.
inlong-tubemq/tubemq-client/src/main/java/org/apache/inlong/tubemq/client/consumer/SimpleClientBalanceConsumer.java