diff options
author | Benety Goh <benety@mongodb.com> | 2016-07-14 14:28:00 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2016-07-15 11:00:27 -0400 |
commit | 0540efd2385116e7e5cfe893efd94f330c3f3d5b (patch) | |
tree | 7b9dcedf8464dfda3083d0000c0e7b0bd3b52ea2 | |
parent | e5e2ecb49da979c5cc3534ae3cb76212a72e3986 (diff) | |
download | mongo-0540efd2385116e7e5cfe893efd94f330c3f3d5b.tar.gz |
SERVER-25069 added ReplicationCoordinatorExternalState::getDbWorkThreadPool()
5 files changed, 16 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_external_state.h b/src/mongo/db/repl/replication_coordinator_external_state.h index 245b37cca7f..35cf9572fdb 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state.h +++ b/src/mongo/db/repl/replication_coordinator_external_state.h @@ -43,6 +43,7 @@ namespace mongo { class BSONObj; class OID; +class OldThreadPool; class OperationContext; class ServiceContext; class SnapshotName; @@ -118,6 +119,11 @@ public: virtual executor::TaskExecutor* getTaskExecutor() const = 0; /** + * Returns shared db worker thread pool for collection cloning. + */ + virtual OldThreadPool* getDbWorkThreadPool() const = 0; + + /** * Creates the oplog, writes the first entry and stores the replica set config document. */ virtual Status initializeReplSetStorage(OperationContext* txn, const BSONObj& config) = 0; diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp index 3f1333a2f60..418f1eacd50 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp @@ -244,6 +244,10 @@ executor::TaskExecutor* ReplicationCoordinatorExternalStateImpl::getTaskExecutor return _taskExecutor.get(); } +OldThreadPool* ReplicationCoordinatorExternalStateImpl::getDbWorkThreadPool() const { + return _writerPool.get(); +} + Status ReplicationCoordinatorExternalStateImpl::initializeReplSetStorage(OperationContext* txn, const BSONObj& config) { try { diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.h b/src/mongo/db/repl/replication_coordinator_external_state_impl.h index 488e8babcc0..60349f49a3c 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.h +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.h @@ -66,6 +66,7 @@ public: virtual void startMasterSlave(OperationContext* txn); virtual void shutdown(OperationContext* txn); virtual executor::TaskExecutor* getTaskExecutor() const override; + virtual OldThreadPool* getDbWorkThreadPool() const override; virtual Status initializeReplSetStorage(OperationContext* txn, const BSONObj& config); virtual void logTransitionToPrimaryToOplog(OperationContext* txn); virtual void forwardSlaveProgress(); diff --git a/src/mongo/db/repl/replication_coordinator_external_state_mock.cpp b/src/mongo/db/repl/replication_coordinator_external_state_mock.cpp index 14be14c2f98..6cd22b4ea82 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_mock.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_mock.cpp @@ -88,6 +88,10 @@ executor::TaskExecutor* ReplicationCoordinatorExternalStateMock::getTaskExecutor return nullptr; } +OldThreadPool* ReplicationCoordinatorExternalStateMock::getDbWorkThreadPool() const { + return nullptr; +} + void ReplicationCoordinatorExternalStateMock::forwardSlaveProgress() {} OID ReplicationCoordinatorExternalStateMock::ensureMe(OperationContext*) { diff --git a/src/mongo/db/repl/replication_coordinator_external_state_mock.h b/src/mongo/db/repl/replication_coordinator_external_state_mock.h index 5cc8366951a..6f0693d255f 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_mock.h +++ b/src/mongo/db/repl/replication_coordinator_external_state_mock.h @@ -65,6 +65,7 @@ public: virtual void startMasterSlave(OperationContext*); virtual void shutdown(OperationContext* txn); virtual executor::TaskExecutor* getTaskExecutor() const override; + virtual OldThreadPool* getDbWorkThreadPool() const override; virtual Status initializeReplSetStorage(OperationContext* txn, const BSONObj& config); virtual void logTransitionToPrimaryToOplog(OperationContext* txn); virtual void forwardSlaveProgress(); |