public void processRebalance(long rebalanceId, boolean isFirstReb,
            List<String> groups, StringBuilder strBuffer) {
        // #lizard forgives
        Map<String, Map<String, List<Partition>>> finalSubInfoMap;
        // choose different load balance strategy
        if (isFirstReb) {
            finalSubInfoMap = this.loadBalancer.bukAssign(consumerHolder,
                    brokerRunManager, groups, defMetaDataService, strBuffer);
        } else {
            finalSubInfoMap = this.loadBalancer.balanceCluster(currentSubInfo,
                    consumerHolder, brokerRunManager, groups, defMetaDataService, strBuffer);
        }
        boolean included;
        String consumerId;
        boolean isDelEmpty;
        boolean isAddEmtpy;
        ConsumerInfo consumerInfo;
        Set<String> blackTopicSet;
        List<SubscribeInfo> deletedSubInfoList;
        List<SubscribeInfo> addedSubInfoList;
        Map<String, Partition> currentPartMap;
        Map<String, Map<String, Partition>> curTopicSubInfoMap;
        // allocate partitions to consumers
        for (Map.Entry<String, Map<String, List<Partition>>> entry : finalSubInfoMap.entrySet()) {
            if (entry == null) {
                continue;
            }
            consumerId = entry.getKey();
            if (consumerId == null) {
                continue;
            }
            consumerInfo = consumerHolder.getConsumerInfo(consumerId);
            if (consumerInfo == null) {
                continue;
            }
            addedSubInfoList = new ArrayList<>();
            deletedSubInfoList = new ArrayList<>();
            blackTopicSet =
                    defMetaDataService.getDisableTopicByGroupName(consumerInfo.getGroupName());
            for (Map.Entry<String, List<Partition>> topicEntry : entry.getValue().entrySet()) {
                if (topicEntry == null) {
                    continue;
                }
                curTopicSubInfoMap = currentSubInfo.get(consumerId);
                if (curTopicSubInfoMap == null
                        || curTopicSubInfoMap.get(topicEntry.getKey()) == null) {
                    currentPartMap = new HashMap<>();
                } else {
                    currentPartMap = curTopicSubInfoMap.get(topicEntry.getKey());
                    if (currentPartMap == null) {
                        currentPartMap = new HashMap<>();
                    }
                }
                for (Partition currentPart : currentPartMap.values()) {
                    included = false;
                    if (!blackTopicSet.contains(currentPart.getTopic())) {
                        for (Partition newPart : topicEntry.getValue()) {
                            if (newPart == null) {
                                continue;
                            }
                            if (newPart.getPartitionKey().equals(
                                    currentPart.getPartitionKey())) {
                                included = true;
                                break;
                            }
                        }
                    }
                    if (!included) {
                        deletedSubInfoList.add(new SubscribeInfo(consumerId,
                                consumerInfo.getGroupName(), consumerInfo.isOverTLS(), currentPart));
                    }
                }
                for (Partition finalPart : topicEntry.getValue()) {
                    if ((currentPartMap.get(finalPart.getPartitionKey()) == null)
                            && (!blackTopicSet.contains(finalPart.getTopic()))) {
                        addedSubInfoList.add(new SubscribeInfo(consumerId,
                                consumerInfo.getGroupName(), consumerInfo.isOverTLS(), finalPart));
                    }
                }
            }
            isDelEmpty = deletedSubInfoList.isEmpty();
            isAddEmtpy = addedSubInfoList.isEmpty();
            if (!isDelEmpty) {
                consumerEventManager.addDisconnectEvent(consumerId,
                        new ConsumerEvent(rebalanceId,
                                (!isAddEmtpy) ? EventType.DISCONNECT : EventType.ONLY_DISCONNECT,
                                deletedSubInfoList, EventStatus.TODO));
                printTODOContent(rebalanceId, consumerId,
                        "Disconnect", deletedSubInfoList, strBuffer);
            }
            if (!isAddEmtpy) {
                consumerEventManager.addConnectEvent(consumerId,
                        new ConsumerEvent(rebalanceId,
                                (!isDelEmpty) ? EventType.CONNECT : EventType.ONLY_CONNECT,
                                addedSubInfoList, EventStatus.TODO));
                printTODOContent(rebalanceId, consumerId,
                        "Connect", addedSubInfoList, strBuffer);
            }
        }
    }
process unReset group balance

@param rebalanceId   the re-balance id
@param isFirstReb    whether is first re-balance
@param groups        the need re-balance group set
@param strBuffer     string buffer
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/TMaster.java