31 #include "mongo/base/shim.h" 32 #include "mongo/db/collection_index_usage_tracker.h" 33 #include "mongo/db/query/plan_cache.h" 34 #include "mongo/db/query/query_settings.h" 35 #include "mongo/db/update_index_data.h" 36 #include "mongo/stdx/functional.h" 40 class IndexDescriptor;
41 class OperationContext;
61 virtual void init(OperationContext* opCtx) = 0;
63 virtual void addedIndex(OperationContext* opCtx,
const IndexDescriptor*
desc) = 0;
65 virtual void droppedIndex(OperationContext* opCtx, StringData indexName) = 0;
70 const std::set<std::string>& indexesUsed) = 0;
76 const NamespaceString&
ns,
77 PrivateTo<CollectionInfoCache>)
78 ->std::unique_ptr<Impl>) makeImpl;
156 const std::set<std::string>& indexesUsed) {
167 static void hook() noexcept;
Impl & _impl()
Definition: collection_info_cache.h:180
virtual void init(OperationContext *opCtx)=0
const UpdateIndexData & getIndexKeys(OperationContext *const opCtx) const
Definition: collection_info_cache.h:109
void clearQueryCache()
Removes all cached query plans.
Definition: collection_info_cache.h:147
Collection *const const NamespaceString & ns
Definition: collection_info_cache_impl.cpp:53
TUHook() noexcept
Definition: collection_info_cache.h:169
static MONGO_DECLARE_SHIM((Collection *collection, const NamespaceString &ns, PrivateTo< CollectionInfoCache >) ->std::unique_ptr< Impl >) makeImpl
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
Collection *const collection
Definition: collection_info_cache_impl.cpp:53
void init(OperationContext *const opCtx)
Builds internal cache state based on the current state of the Collection's IndexCatalog.
Definition: collection_info_cache.h:88
void droppedIndex(OperationContext *const opCtx, const StringData indexName)
Deregister a newly-dropped index with the cache.
Definition: collection_info_cache.h:140
std::unique_ptr< Impl > _pimpl
Definition: collection_info_cache.h:160
CollectionInfoCache(Collection *const collection, const NamespaceString &ns)
Definition: collection_info_cache.h:80
void notifyOfQuery(OperationContext *const opCtx, const std::set< std::string > &indexesUsed)
Signal to the cache that a query operation has completed.
Definition: collection_info_cache.h:155
virtual QuerySettings * getQuerySettings() const =0
Definition: collection_info_cache.h:49
virtual void addedIndex(OperationContext *opCtx, const IndexDescriptor *desc)=0
virtual void droppedIndex(OperationContext *opCtx, StringData indexName)=0
this is NOT safe through a yield right now.
Definition: collection.h:160
virtual void notifyOfQuery(OperationContext *opCtx, const std::set< std::string > &indexesUsed)=0
~CollectionInfoCache()=default
QuerySettings * getQuerySettings() const
Get the QuerySettings for this collection.
Definition: collection_info_cache.h:102
Definition: collection_info_cache.h:166
virtual void clearQueryCache()=0
virtual PlanCache * getPlanCache() const =0
CollectionIndexUsageMap getIndexUsageStats() const
Returns cached index usage statistics for this collection.
Definition: collection_info_cache.h:120
virtual const UpdateIndexData & getIndexKeys(OperationContext *opCtx) const =0
PlanCache * getPlanCache() const
Get the PlanCache for this collection.
Definition: collection_info_cache.h:95
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
virtual CollectionIndexUsageMap getIndexUsageStats() const =0
void addedIndex(OperationContext *const opCtx, const IndexDescriptor *const desc)
Register a newly-created index with the cache.
Definition: collection_info_cache.h:130
OperationContext const IndexDescriptor * desc
Definition: index_catalog_impl.cpp:97
this is for storing things that you want to cache about a single collection life cycle is managed for...
Definition: collection_info_cache.h:47
const Impl & _impl() const
Definition: collection_info_cache.h:175