feat: export SetBackgroundThreads(n, Env::BOTTOM); (#7191)

Summary:
- https://github.com/rust-rocksdb/rust-rocksdb/pull/448

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7191

Reviewed By: riversand963

Differential Revision: D22809066

Pulled By: ajkr

fbshipit-source-id: 036939f9a28cacc3f677c318d1aed97fe5f4f85e
This commit is contained in:
codingsh 2020-07-29 12:22:48 -07:00 committed by Facebook GitHub Bot
parent a38f04ac26
commit 50f206ad84
2 changed files with 14 additions and 0 deletions

10
db/c.cc
View File

@ -3831,10 +3831,20 @@ void rocksdb_env_set_background_threads(rocksdb_env_t* env, int n) {
env->rep->SetBackgroundThreads(n); env->rep->SetBackgroundThreads(n);
} }
void rocksdb_env_set_bottom_priority_background_threads(rocksdb_env_t* env,
int n) {
env->rep->SetBackgroundThreads(n, Env::BOTTOM);
}
void rocksdb_env_set_high_priority_background_threads(rocksdb_env_t* env, int n) { void rocksdb_env_set_high_priority_background_threads(rocksdb_env_t* env, int n) {
env->rep->SetBackgroundThreads(n, Env::HIGH); env->rep->SetBackgroundThreads(n, Env::HIGH);
} }
void rocksdb_env_set_low_priority_background_threads(rocksdb_env_t* env,
int n) {
env->rep->SetBackgroundThreads(n, Env::LOW);
}
void rocksdb_env_join_all_threads(rocksdb_env_t* env) { void rocksdb_env_join_all_threads(rocksdb_env_t* env) {
env->rep->WaitForJoin(); env->rep->WaitForJoin();
} }

View File

@ -1555,6 +1555,10 @@ extern ROCKSDB_LIBRARY_API void rocksdb_env_set_background_threads(
rocksdb_env_t* env, int n); rocksdb_env_t* env, int n);
extern ROCKSDB_LIBRARY_API void extern ROCKSDB_LIBRARY_API void
rocksdb_env_set_high_priority_background_threads(rocksdb_env_t* env, int n); rocksdb_env_set_high_priority_background_threads(rocksdb_env_t* env, int n);
extern ROCKSDB_LIBRARY_API void rocksdb_env_set_low_priority_background_threads(
rocksdb_env_t* env, int n);
extern ROCKSDB_LIBRARY_API void
rocksdb_env_set_bottom_priority_background_threads(rocksdb_env_t* env, int n);
extern ROCKSDB_LIBRARY_API void rocksdb_env_join_all_threads( extern ROCKSDB_LIBRARY_API void rocksdb_env_join_all_threads(
rocksdb_env_t* env); rocksdb_env_t* env);
extern ROCKSDB_LIBRARY_API void rocksdb_env_lower_thread_pool_io_priority(rocksdb_env_t* env); extern ROCKSDB_LIBRARY_API void rocksdb_env_lower_thread_pool_io_priority(rocksdb_env_t* env);