diff options
author | sdong <siying.d@fb.com> | 2014-11-03 14:11:33 -0800 |
---|---|---|
committer | sdong <siying.d@fb.com> | 2014-11-03 17:22:34 -0800 |
commit | 09899f0b51977366b92dc2e71cd77aa5fa6e9836 (patch) | |
tree | ddb98a3e4b5fbf8bba0f30667c44397c3895538e /hdfs | |
parent | 636e57b52dc699fee435d627470d757c09f80501 (diff) |
DB::Open() to automatically increase thread pool size if it is smaller than max number of parallel compactions or flushes
Summary:
With the patch, thread pool size will be automatically increased if DB's options ask for more parallelism of compactions or flushes.
Too many users have been confused by the API. Change it to make it harder for users to make mistakes
Test Plan: Add two unit tests to cover the function.
Reviewers: yhchiang, rven, igor, MarkCallaghan, ljin
Reviewed By: ljin
Subscribers: dhruba, leveldb
Differential Revision: https://reviews.facebook.net/D27555
Diffstat (limited to 'hdfs')
-rw-r--r-- | hdfs/env_hdfs.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hdfs/env_hdfs.h b/hdfs/env_hdfs.h index 5e7de77d3..82f317f73 100644 --- a/hdfs/env_hdfs.h +++ b/hdfs/env_hdfs.h @@ -145,6 +145,10 @@ class HdfsEnv : public Env { posixEnv->SetBackgroundThreads(number, pri); } + virtual void IncBackgroundThreadsIfNeeded(int number, Priority pri) override { + posixEnv->IncBackgroundThreadsIfNeeded(number, pri); + } + virtual std::string TimeToString(uint64_t number) { return posixEnv->TimeToString(number); } @@ -319,7 +323,7 @@ class HdfsEnv : public Env { std::string* outputpath) {return notsup;} virtual void SetBackgroundThreads(int number, Priority pri = LOW) {} - + virtual void IncBackgroundThreadsIfNeeded(int number, Priority pri) {} virtual std::string TimeToString(uint64_t number) { return "";} }; } |