diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2020-02-25 06:30:34 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-27 03:49:38 +0000 |
commit | d3df81cac59e3dd216c60e87b74ac7c444343201 (patch) | |
tree | 9dc828efea8de8a47e0f45cd30dbe3970c10358a /src/mongo/util/read_through_cache.h | |
parent | 38e8d980ed07b30d89e9906a2997ae6cc3cdc694 (diff) | |
download | mongo-d3df81cac59e3dd216c60e87b74ac7c444343201.tar.gz |
SERVER-44978 Move the "cache generation" to AuthorizationManagerImpl
The "cache generation" concept is something specific to the
Authorization Manager and doesn't fit with an asynchronous (non
totally-ordered cache). This change moves it out of the ReadThroughCache
and makes it an AuthorizationManager concept.
Diffstat (limited to 'src/mongo/util/read_through_cache.h')
-rw-r--r-- | src/mongo/util/read_through_cache.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/mongo/util/read_through_cache.h b/src/mongo/util/read_through_cache.h index 54e5d4bfc45..bf8b377f6ec 100644 --- a/src/mongo/util/read_through_cache.h +++ b/src/mongo/util/read_through_cache.h @@ -48,12 +48,6 @@ class ReadThroughCacheBase { ReadThroughCacheBase(const ReadThroughCacheBase&) = delete; ReadThroughCacheBase& operator=(const ReadThroughCacheBase&) = delete; -public: - /** - * Returns the cache generation identifier. - */ - OID getCacheGeneration() const; - protected: ReadThroughCacheBase(Mutex& mutex, ServiceContext* service, ThreadPoolInterface& threadPool); @@ -380,13 +374,11 @@ public: void invalidateIf(const Pred& predicate) { CacheGuard guard(this); _updateCacheGeneration(guard); - _cache.invalidateIf([&](const Key& key, const StoredValue* storedValue) { - return predicate(key, &storedValue->value); - }); + _cache.invalidateIf([&](const Key& key, const StoredValue*) { return predicate(key); }); } void invalidateAll() { - invalidateIf([](const Key&, const Value*) { return true; }); + invalidateIf([](const Key&) { return true; }); } /** |