@Override
    public void flushLast(boolean force) throws IOException {
        final Segment[] curViews = segmentList.get();
        if (curViews.length == 0) {
            return;
        }
        Segment last = curViews[curViews.length - 1];
        if (last == null) {
            return;
        }
        last.flush(force);
    }
Check FileSegments whether is expired, close all expired FileSegments, and then delete these files.

@param sb   string buffer
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/msgstore/disk/FileSegmentList.java