public long getIndexMaxOffset() {
        long lastOffset = 0L;
        if (tubeConfig.isEnableMemStore()) {
            this.writeCacheMutex.readLock().lock();
            try {
                lastOffset = this.msgMemStore.getIndexLastWritePos();
            } finally {
                this.writeCacheMutex.readLock().unlock();
            }
        } else {
            lastOffset = msgFileStore.getIndexMaxOffset();
        }
        return lastOffset;
    }
Get the index max offset
Read from cache settings if memory cache is enabled, otherwise directly from file store

@return  the current index offset
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/msgstore/MessageStore.java