public ConsumerInfo removeConsumer(String consumerId) {
        if (consumerId == null) {
            return null;
        }
        try {
            csmInfoRWLock.writeLock().lock();
            this.balanceNodeMap.remove(consumerId);
            List<String> partKeyList = new ArrayList<>();
            for (Map.Entry<String, String> entry : partitionInfoMap.entrySet()) {
                if (entry.getValue() != null) {
                    if (entry.getValue().equals(consumerId)) {
                        partKeyList.add(entry.getKey());
                    }
                }
            }
            for (String partKey : partKeyList) {
                partitionInfoMap.remove(partKey);
                partOffsetMap.remove(partKey);
            }
            return this.consumerInfoMap.remove(consumerId);
        } finally {
            csmInfoRWLock.writeLock().unlock();
        }
    }
Remove consumer

@param consumerId consumer id
@return  consumer object
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/nodemanage/nodeconsumer/ConsumeGroupInfo.java