public void restoreBackup(final String backupDBPath, final RocksDBBackupInfo rocksBackupInfo) {
        final Timer.Context timeCtx = getTimeContext("RESTORE_BACKUP");
        final Lock writeLock = this.readWriteLock.writeLock();
        writeLock.lock();
        closeRocksDB();
        try (final BackupEngineOptions backupOpts = createBackupDBOptions(backupDBPath);
                final BackupEngine backupEngine = BackupEngine.open(this.options.getEnv(), backupOpts);
                final RestoreOptions restoreOpts = new RestoreOptions(false)) {
            final String dbPath = this.opts.getDbPath();
            backupEngine.restoreDbFromBackup(rocksBackupInfo.getBackupId(), dbPath, dbPath, restoreOpts);
            LOG.info("Restored rocksDB from {} with {}.", backupDBPath, rocksBackupInfo);
            // reopen the db
            openRocksDB(this.opts);
        } catch (final RocksDBException e) {
            throw new StorageException("Fail to restore from path: " + backupDBPath, e);
        } finally {
            writeLock.unlock();
            timeCtx.stop();
        }
    }
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