summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2020-01-16 11:00:56 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-01-16 17:52:44 +0000
commit4ea0e5f400e2dc8a18c2cf407f13e7780d0c5d14 (patch)
tree892a14549dafb47e7694d9f8a19b21f35f97a389 /src/mongo/db/auth
parenta60b866fa9c7b89e2fab3a60432f54ca0492be9f (diff)
downloadmongo-4ea0e5f400e2dc8a18c2cf407f13e7780d0c5d14.tar.gz
SERVER-43721 Rename DistCache to ReadThroughCache
No functional changes, just rename. rename src/mongo/util/{dist_cache.cpp => read_through_cache.cpp} (84%) rename src/mongo/util/{dist_cache.h => read_through_cache.h} (90%) rename src/mongo/util/{dist_cache_test.cpp => read_through_cache_test.cpp} (88%)
Diffstat (limited to 'src/mongo/db/auth')
-rw-r--r--src/mongo/db/auth/authorization_manager_impl.cpp16
-rw-r--r--src/mongo/db/auth/authorization_manager_impl.h14
-rw-r--r--src/mongo/db/auth/user.h6
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