@Override
    public void close() throws IOException {
        if (this.closed.compareAndSet(false, true)) {
            StringBuilder strBuffer = new StringBuilder(512);
            logger.info(strBuffer.append("[Data Store] Stop current Message store ")
                    .append(this.storeKey).toString());
            strBuffer.delete(0, strBuffer.length());
            if (tubeConfig.isEnableMemStore()) {
                ThreadUtils.sleep(100);
                flush(strBuffer);
                this.msgMemStore.close();
                this.msgMemStoreBeingFlush.close();
                this.executor.shutdown();
            }
            this.msgFileStore.close();
            logger.info(strBuffer.append("[Data Store] Message store stopped")
                    .append(this.storeKey).toString());
        }
    }
Flush memory store to file.

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