private void rmvOffset(String group, Map<String, Set<Integer>> topicPartMap) {
        if (group == null
                || topicPartMap == null
                || topicPartMap.isEmpty()) {
            return;
        }
        // remove confirm offset
        ConcurrentHashMap<String, OffsetStorageInfo> regInfoMap = cfmOffsetMap.get(group);
        if (regInfoMap != null) {
            for (Map.Entry<String, Set<Integer>> entry : topicPartMap.entrySet()) {
                if (entry.getKey() == null
                        || entry.getValue() == null
                        || entry.getValue().isEmpty()) {
                    continue;
                }
                for (Integer partitionId : entry.getValue()) {
                    regInfoMap.remove(OffsetStgInfo.buildOffsetKey(entry.getKey(), partitionId));
                }
            }
            if (regInfoMap.isEmpty()) {
                cfmOffsetMap.remove(group);
            }
        }
        // remove tmp offset
        ConcurrentHashMap<String, Long> tmpRegInfoMap = tmpOffsetMap.get(group);
        if (tmpRegInfoMap != null) {
            for (Map.Entry<String, Set<Integer>> entry : topicPartMap.entrySet()) {
                if (entry.getKey() == null
                        || entry.getValue() == null
                        || entry.getValue().isEmpty()) {
                    continue;
                }
                for (Integer partitionId : entry.getValue()) {
                    tmpRegInfoMap.remove(OffsetStgInfo.buildOffsetKey(entry.getKey(), partitionId));
                }
            }
            if (tmpRegInfoMap.isEmpty()) {
                tmpOffsetMap.remove(group);
            }
        }
    }
Load or create offset.

@param group            the consume group name
@param topic            the consumed topic name
@param partitionId      the consumed partition id
@param offsetCacheKey   the offset store key
@param defOffset        the default offset if not found
@return                 the stored offset object
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/offset/DefaultOffsetManager.java