public void flushDiskFile() throws IOException {
        long checkTimestamp = System.currentTimeMillis();
        if ((curUnflushed.get() > 0)
                && (checkTimestamp - lastFlushTime.get() >= messageStore.getUnflushInterval())) {
            long flushedMsgCnt = 0L;
            long flushedDataSize = 0L;
            boolean forceMetadata = false;
            this.writeLock.lock();
            try {
                checkTimestamp = System.currentTimeMillis();
                if ((curUnflushed.get() >= 0)
                        && (checkTimestamp - lastFlushTime.get() >= messageStore.getUnflushInterval())) {
                    forceMetadata =
                            (checkTimestamp - lastMetaFlushTime.get()) > MAX_META_REFRESH_DUR;
                    dataSegments.flushLast(forceMetadata);
                    indexSegments.flushLast(forceMetadata);
                    if (forceMetadata) {
                        this.lastMetaFlushTime.set(checkTimestamp);
                    }
                    flushedMsgCnt = curUnflushed.getAndSet(0);
                    flushedDataSize = curUnflushSize.getAndSet(0);
                    lastFlushTime.set(checkTimestamp);
                }
            } finally {
                this.writeLock.unlock();
                msgStoreStatsHolder.addFileTimeoutFlushStats(flushedMsgCnt,
                        flushedDataSize, forceMetadata);
            }
        }
        msgStoreStatsHolder.chkStatsExpired(checkTimestamp);
    }
Flush data to disk at interval.

@throws IOException the exception during processing
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/msgstore/disk/MsgFileStore.java