private OffsetStorageInfo loadOrCreateOffset(final String group, final String topic,
            int partitionId, final String offsetCacheKey,
            long defOffset) {
        ConcurrentHashMap<String, OffsetStorageInfo> regInfoMap = cfmOffsetMap.get(group);
        if (regInfoMap == null) {
            ConcurrentHashMap<String, OffsetStorageInfo> loadedStgInfo =
                    fileOffsetStorage.loadGroupStgInfo(group);
            regInfoMap = cfmOffsetMap.putIfAbsent(group, loadedStgInfo);
            if (regInfoMap == null) {
                regInfoMap = loadedStgInfo;
            }
        }
        OffsetStorageInfo regInfo = regInfoMap.get(offsetCacheKey);
        if (regInfo == null) {
            OffsetStorageInfo tmpRegInfo =
                    fileOffsetStorage.loadOffset(group, topic, partitionId);
            if (tmpRegInfo == null) {
                tmpRegInfo = new OffsetStorageInfo(topic,
                        brokerConfig.getBrokerId(), partitionId, 0, defOffset, 0);
            }
            regInfo = regInfoMap.putIfAbsent(offsetCacheKey, tmpRegInfo);
            if (regInfo == null) {
                regInfo = tmpRegInfo;
            }
        }
        return regInfo;
    }
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