From 712458fc344020b8cc7b6a0913a8523d2b8f7da1 Mon Sep 17 00:00:00 2001 From: rafael-aero Date: Wed, 8 Jul 2020 11:54:30 -0700 Subject: [PATCH] Add RestoreDBFromLatestBackup to C API, add new C# package (#7092) Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/7092 Reviewed By: riversand963 Differential Revision: D22412323 Pulled By: ajkr fbshipit-source-id: 3fc1c63bb19a8cd2c0ae620800c28f199a7f494b --- LANGUAGE-BINDINGS.md | 4 +++- db/c.cc | 9 +++++++++ include/rocksdb/c.h | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/LANGUAGE-BINDINGS.md b/LANGUAGE-BINDINGS.md index 73c2355a5..ac35f6be0 100644 --- a/LANGUAGE-BINDINGS.md +++ b/LANGUAGE-BINDINGS.md @@ -10,7 +10,9 @@ This is the list of all known third-party language bindings for RocksDB. If some * Ruby - http://rubygems.org/gems/rocksdb-ruby * Haskell - https://hackage.haskell.org/package/rocksdb-haskell * PHP - https://github.com/Photonios/rocksdb-php -* C# - https://github.com/warrenfalk/rocksdb-sharp +* C# + * https://github.com/warrenfalk/rocksdb-sharp + * https://github.com/curiosity-ai/rocksdb-sharp * Rust * https://github.com/pingcap/rust-rocksdb (used in production fork of https://github.com/spacejam/rust-rocksdb) * https://github.com/spacejam/rust-rocksdb diff --git a/db/c.cc b/db/c.cc index 4528d2cad..265f6d014 100644 --- a/db/c.cc +++ b/db/c.cc @@ -595,6 +595,15 @@ void rocksdb_backup_engine_restore_db_from_latest_backup( restore_options->rep)); } +void rocksdb_backup_engine_restore_db_from_backup( + rocksdb_backup_engine_t* be, const char* db_dir, const char* wal_dir, + const rocksdb_restore_options_t* restore_options, const uint32_t backup_id, + char** errptr) { + SaveError(errptr, be->rep->RestoreDBFromBackup(backup_id, std::string(db_dir), + std::string(wal_dir), + restore_options->rep)); +} + const rocksdb_backup_engine_info_t* rocksdb_backup_engine_get_backup_info( rocksdb_backup_engine_t* be) { rocksdb_backup_engine_info_t* result = new rocksdb_backup_engine_info_t; diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 0c7de1938..735700b33 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -171,6 +171,11 @@ rocksdb_backup_engine_restore_db_from_latest_backup( rocksdb_backup_engine_t* be, const char* db_dir, const char* wal_dir, const rocksdb_restore_options_t* restore_options, char** errptr); +extern ROCKSDB_LIBRARY_API void rocksdb_backup_engine_restore_db_from_backup( + rocksdb_backup_engine_t* be, const char* db_dir, const char* wal_dir, + const rocksdb_restore_options_t* restore_options, const uint32_t backup_id, + char** errptr); + extern ROCKSDB_LIBRARY_API const rocksdb_backup_engine_info_t* rocksdb_backup_engine_get_backup_info(rocksdb_backup_engine_t* be);