Add C bindings for LowerThreadPoolIO/CPUPriority (#5285)
Summary: There were no C bindings for lowering thread pool priority. This adds those. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5285 Differential Revision: D15290050 Pulled By: siying fbshipit-source-id: b2ed94d0c39d27434ace2204829a242b53d0d67a
This commit is contained in:
parent
9fad3e21eb
commit
6451673f37
16
db/c.cc
16
db/c.cc
@ -3268,6 +3268,22 @@ void rocksdb_env_join_all_threads(rocksdb_env_t* env) {
|
|||||||
env->rep->WaitForJoin();
|
env->rep->WaitForJoin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rocksdb_env_lower_thread_pool_io_priority(rocksdb_env_t* env) {
|
||||||
|
env->rep->LowerThreadPoolIOPriority();
|
||||||
|
}
|
||||||
|
|
||||||
|
void rocksdb_env_lower_high_priority_thread_pool_io_priority(rocksdb_env_t* env) {
|
||||||
|
env->rep->LowerThreadPoolIOPriority(Env::HIGH);
|
||||||
|
}
|
||||||
|
|
||||||
|
void rocksdb_env_lower_thread_pool_cpu_priority(rocksdb_env_t* env) {
|
||||||
|
env->rep->LowerThreadPoolCPUPriority();
|
||||||
|
}
|
||||||
|
|
||||||
|
void rocksdb_env_lower_high_priority_thread_pool_cpu_priority(rocksdb_env_t* env) {
|
||||||
|
env->rep->LowerThreadPoolCPUPriority(Env::HIGH);
|
||||||
|
}
|
||||||
|
|
||||||
void rocksdb_env_destroy(rocksdb_env_t* env) {
|
void rocksdb_env_destroy(rocksdb_env_t* env) {
|
||||||
if (!env->is_default) delete env->rep;
|
if (!env->is_default) delete env->rep;
|
||||||
delete env;
|
delete env;
|
||||||
|
@ -1301,6 +1301,11 @@ 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_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_high_priority_thread_pool_io_priority(rocksdb_env_t* env);
|
||||||
|
extern ROCKSDB_LIBRARY_API void rocksdb_env_lower_thread_pool_cpu_priority(rocksdb_env_t* env);
|
||||||
|
extern ROCKSDB_LIBRARY_API void rocksdb_env_lower_high_priority_thread_pool_cpu_priority(rocksdb_env_t* env);
|
||||||
|
|
||||||
extern ROCKSDB_LIBRARY_API void rocksdb_env_destroy(rocksdb_env_t*);
|
extern ROCKSDB_LIBRARY_API void rocksdb_env_destroy(rocksdb_env_t*);
|
||||||
|
|
||||||
extern ROCKSDB_LIBRARY_API rocksdb_envoptions_t* rocksdb_envoptions_create();
|
extern ROCKSDB_LIBRARY_API rocksdb_envoptions_t* rocksdb_envoptions_create();
|
||||||
|
Loading…
Reference in New Issue
Block a user