diff options
author | Benety Goh <benety@mongodb.com> | 2016-07-14 15:43:40 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2016-07-15 16:42:38 -0400 |
commit | 292d84272ba6a548e9c81064bcdab00dd1acf2a3 (patch) | |
tree | 8642d044f9492800d0a41f398dfd6a024ebe0193 /src/mongo/db/repl/databases_cloner.h | |
parent | e567346a1cc02c9edb8f33c8102a4cc35d1d70f2 (diff) | |
download | mongo-292d84272ba6a548e9c81064bcdab00dd1acf2a3.tar.gz |
SERVER-25069 DatabasesCloner accepts db worker thread pool at construction
Diffstat (limited to 'src/mongo/db/repl/databases_cloner.h')
-rw-r--r-- | src/mongo/db/repl/databases_cloner.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/repl/databases_cloner.h b/src/mongo/db/repl/databases_cloner.h index b9189052446..27b9bddc5ce 100644 --- a/src/mongo/db/repl/databases_cloner.h +++ b/src/mongo/db/repl/databases_cloner.h @@ -46,6 +46,9 @@ #include "mongo/util/net/hostandport.h" namespace mongo { + +class OldThreadPool; + namespace repl { namespace { @@ -64,6 +67,7 @@ public: using OnFinishFn = stdx::function<void(const Status&)>; DatabasesCloner(StorageInterface* si, executor::TaskExecutor* exec, + OldThreadPool* dbWorkThreadPool, HostAndPort source, IncludeDbFilterFn includeDbPred, OnFinishFn finishFn); @@ -112,8 +116,9 @@ private: mutable stdx::mutex _mutex; // (S) Status _status{ErrorCodes::NotYetInitialized, ""}; // (M) If it is not OK, we stop everything. executor::TaskExecutor* _exec; // (R) executor to schedule things with - HostAndPort _source; // (R) The source to use, until we get an error - bool _active = false; // (M) false until we start + OldThreadPool* _dbWorkThreadPool; // (R) db worker thread pool for collection cloning. + HostAndPort _source; // (R) The source to use, until we get an error + bool _active = false; // (M) false until we start std::vector<std::shared_ptr<DatabaseCloner>> _databaseCloners; // (M) database cloners by name int _clonersActive = 0; // (M) Number of active cloners left. std::unique_ptr<RemoteCommandRetryScheduler> _listDBsScheduler; // (M) scheduler for listDBs. |