diff options
author | Randolph Tan <randolph@10gen.com> | 2017-05-01 12:02:19 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2017-05-04 16:35:16 -0400 |
commit | c969470f2bdffa66bca8cf8344382a51ec6f3bc4 (patch) | |
tree | 6fc34b2c01dfc40a4b03d0854400d06832ad090e /src/mongo/db/keys_collection_manager.cpp | |
parent | 19096e46bce055f8e65d714a4a3c8608be2400b1 (diff) | |
download | mongo-c969470f2bdffa66bca8cf8344382a51ec6f3bc4.tar.gz |
SERVER-28127 Break link dependency cycle from KeysCollectionManager
Diffstat (limited to 'src/mongo/db/keys_collection_manager.cpp')
-rw-r--r-- | src/mongo/db/keys_collection_manager.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/db/keys_collection_manager.cpp b/src/mongo/db/keys_collection_manager.cpp index 61cd43f73f1..12fd318df09 100644 --- a/src/mongo/db/keys_collection_manager.cpp +++ b/src/mongo/db/keys_collection_manager.cpp @@ -74,10 +74,13 @@ Milliseconds howMuchSleepNeedFor(const LogicalTime& currentTime, } // unnamed namespace -KeysCollectionManager::KeysCollectionManager(std::string purpose, Seconds keyValidForInterval) +KeysCollectionManager::KeysCollectionManager(std::string purpose, + ShardingCatalogClient* client, + Seconds keyValidForInterval) : _purpose(std::move(purpose)), _keyValidForInterval(keyValidForInterval), - _keysCache(_purpose) {} + _catalogClient(client), + _keysCache(_purpose, client) {} StatusWith<KeysCollectionDocument> KeysCollectionManager::getKeyForValidation( OperationContext* opCtx, long long keyId, const LogicalTime& forThisTime) { @@ -170,7 +173,8 @@ void KeysCollectionManager::stopMonitoring() { void KeysCollectionManager::enableKeyGenerator(OperationContext* opCtx, bool doEnable) { if (doEnable) { _refresher.switchFunc(opCtx, [this](OperationContext* opCtx) { - KeysCollectionCacheReaderAndUpdater keyGenerator(_purpose, _keyValidForInterval); + KeysCollectionCacheReaderAndUpdater keyGenerator( + _purpose, _catalogClient, _keyValidForInterval); auto keyGenerationStatus = keyGenerator.refresh(opCtx); if (ErrorCodes::isShutdownError(keyGenerationStatus.getStatus().code())) { |