diff options
Diffstat (limited to 'src/mongo/db/auth')
-rw-r--r-- | src/mongo/db/auth/authorization_manager_impl.cpp | 16 | ||||
-rw-r--r-- | src/mongo/db/auth/authorization_manager_impl.h | 14 | ||||
-rw-r--r-- | src/mongo/db/auth/user.h | 6 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/mongo/db/auth/authorization_manager_impl.cpp b/src/mongo/db/auth/authorization_manager_impl.cpp index 03ba2a98884..f996254981d 100644 --- a/src/mongo/db/auth/authorization_manager_impl.cpp +++ b/src/mongo/db/auth/authorization_manager_impl.cpp @@ -579,11 +579,11 @@ std::vector<AuthorizationManager::CachedUserInfo> AuthorizationManagerImpl::getU return ret; } -AuthorizationManagerImpl::AuthSchemaVersionDistCache::AuthSchemaVersionDistCache( +AuthorizationManagerImpl::AuthSchemaVersionCache::AuthSchemaVersionCache( AuthzManagerExternalState* externalState) - : DistCache(1, _mutex), _externalState(externalState) {} + : ReadThroughCache(1, _mutex), _externalState(externalState) {} -boost::optional<int> AuthorizationManagerImpl::AuthSchemaVersionDistCache::lookup( +boost::optional<int> AuthorizationManagerImpl::AuthSchemaVersionCache::lookup( OperationContext* opCtx, const int& unusedKey) { invariant(unusedKey == 0); @@ -593,16 +593,16 @@ boost::optional<int> AuthorizationManagerImpl::AuthSchemaVersionDistCache::looku return authzVersion; } -AuthorizationManagerImpl::UserDistCacheImpl::UserDistCacheImpl( - AuthSchemaVersionDistCache* authSchemaVersionCache, +AuthorizationManagerImpl::UserCacheImpl::UserCacheImpl( + AuthSchemaVersionCache* authSchemaVersionCache, AuthzManagerExternalState* externalState, int cacheSize) - : UserDistCache(cacheSize, _mutex), + : UserCache(cacheSize, _mutex), _authSchemaVersionCache(authSchemaVersionCache), _externalState(externalState) {} -boost::optional<User> AuthorizationManagerImpl::UserDistCacheImpl::lookup( - OperationContext* opCtx, const UserName& userName) { +boost::optional<User> AuthorizationManagerImpl::UserCacheImpl::lookup(OperationContext* opCtx, + const UserName& userName) { LOG(1) << "Getting user " << userName << " from disk"; // Number of times to retry a user document that fetches due to transient AuthSchemaIncompatible diff --git a/src/mongo/db/auth/authorization_manager_impl.h b/src/mongo/db/auth/authorization_manager_impl.h index ecf7a9b1ace..81951ab3680 100644 --- a/src/mongo/db/auth/authorization_manager_impl.h +++ b/src/mongo/db/auth/authorization_manager_impl.h @@ -160,9 +160,9 @@ private: * Cache which contains at most a single entry (which has key 0), whose value is the version of * the auth schema. */ - class AuthSchemaVersionDistCache : public DistCache<int, int> { + class AuthSchemaVersionCache : public ReadThroughCache<int, int> { public: - AuthSchemaVersionDistCache(AuthzManagerExternalState* externalState); + AuthSchemaVersionCache(AuthzManagerExternalState* externalState); // Even though the dist cache permits for lookup to return boost::none for non-existent // values, the contract of the authorization manager is that it should throw an exception if @@ -179,11 +179,11 @@ private: /** * Cache of the users known to the authentication subsystem. */ - class UserDistCacheImpl : public UserDistCache { + class UserCacheImpl : public UserCache { public: - UserDistCacheImpl(AuthSchemaVersionDistCache* authSchemaVersionCache, - AuthzManagerExternalState* externalState, - int cacheSize); + UserCacheImpl(AuthSchemaVersionCache* authSchemaVersionCache, + AuthzManagerExternalState* externalState, + int cacheSize); // Even though the dist cache permits for lookup to return boost::none for non-existent // values, the contract of the authorization manager is that it should throw an exception if @@ -193,7 +193,7 @@ private: private: Mutex _mutex = MONGO_MAKE_LATCH("AuthorizationManagerImpl::UserDistCacheImpl::_mutex"); - AuthSchemaVersionDistCache* const _authSchemaVersionCache; + AuthSchemaVersionCache* const _authSchemaVersionCache; AuthzManagerExternalState* const _externalState; } _userCache; diff --git a/src/mongo/db/auth/user.h b/src/mongo/db/auth/user.h index c5114d19694..97c9994d2e9 100644 --- a/src/mongo/db/auth/user.h +++ b/src/mongo/db/auth/user.h @@ -42,7 +42,7 @@ #include "mongo/platform/atomic_word.h" #include "mongo/stdx/unordered_map.h" #include "mongo/stdx/unordered_set.h" -#include "mongo/util/dist_cache.h" +#include "mongo/util/read_through_cache.h" namespace mongo { @@ -254,7 +254,7 @@ private: RestrictionDocuments _restrictions; }; -using UserDistCache = DistCache<UserName, User>; -using UserHandle = UserDistCache::ValueHandle; +using UserCache = ReadThroughCache<UserName, User>; +using UserHandle = UserCache::ValueHandle; } // namespace mongo |