CompletableFuture<Void> createSstFiles(final EnumMap<SstColumnFamily, File> sstFileTable, final byte[] startKey,
                                           final byte[] endKey, final ExecutorService executor) {
        final Snapshot snapshot;
        final CompletableFuture<Void> sstFuture = new CompletableFuture<>();
        final Lock readLock = this.readWriteLock.readLock();
        readLock.lock();
        try {
            snapshot = this.db.getSnapshot();
            if (!isAsyncSnapshot()) {
                doCreateSstFiles(snapshot, sstFileTable, startKey, endKey, sstFuture);
                return sstFuture;
            }
        } finally {
            readLock.unlock();
        }

        // async snapshot
        executor.execute(() -> doCreateSstFiles(snapshot, sstFileTable, startKey, endKey, sstFuture));
        return sstFuture;
    }
Local KV store based on RocksDB

@author dennis
@author jiachun.fjc
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/storage/RocksRawKVStore.java