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
main
rafael-aero 5 years ago committed by Facebook GitHub Bot
parent b649d8cb97
commit 712458fc34
  1. 4
      LANGUAGE-BINDINGS.md
  2. 9
      db/c.cc
  3. 5
      include/rocksdb/c.h

@ -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 * Ruby - http://rubygems.org/gems/rocksdb-ruby
* Haskell - https://hackage.haskell.org/package/rocksdb-haskell * Haskell - https://hackage.haskell.org/package/rocksdb-haskell
* PHP - https://github.com/Photonios/rocksdb-php * 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 * Rust
* https://github.com/pingcap/rust-rocksdb (used in production fork of https://github.com/spacejam/rust-rocksdb) * https://github.com/pingcap/rust-rocksdb (used in production fork of https://github.com/spacejam/rust-rocksdb)
* https://github.com/spacejam/rust-rocksdb * https://github.com/spacejam/rust-rocksdb

@ -595,6 +595,15 @@ void rocksdb_backup_engine_restore_db_from_latest_backup(
restore_options->rep)); 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( const rocksdb_backup_engine_info_t* rocksdb_backup_engine_get_backup_info(
rocksdb_backup_engine_t* be) { rocksdb_backup_engine_t* be) {
rocksdb_backup_engine_info_t* result = new rocksdb_backup_engine_info_t; rocksdb_backup_engine_info_t* result = new rocksdb_backup_engine_info_t;

@ -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, rocksdb_backup_engine_t* be, const char* db_dir, const char* wal_dir,
const rocksdb_restore_options_t* restore_options, char** errptr); 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* extern ROCKSDB_LIBRARY_API const rocksdb_backup_engine_info_t*
rocksdb_backup_engine_get_backup_info(rocksdb_backup_engine_t* be); rocksdb_backup_engine_get_backup_info(rocksdb_backup_engine_t* be);

Loading…
Cancel
Save