summaryrefslogtreecommitdiff
path: root/src/mongo/db/views
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2020-08-14 10:23:04 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-02 23:53:39 +0000
commitbf5914a20b596ba3bde772b42e579e028f733bac (patch)
tree2b26469571786d9adb5e95c47990c2416bfab9c4 /src/mongo/db/views
parent6b3e341703b781bb1ff7b1263406a0f1d28dd77c (diff)
downloadmongo-bf5914a20b596ba3bde772b42e579e028f733bac.tar.gz
SERVER-50317 Const correct uses of Collection
Most of the code should only need a const Collection now. AutoGetCollection returns a const Collection by default. There is a placeholder getWritableCollection() interface that will handle the necessary steps we need for lock free reads in the future. Added some operators to AutoGetCollection so it behaves more like a smart pointer.
Diffstat (limited to 'src/mongo/db/views')
-rw-r--r--src/mongo/db/views/durable_view_catalog.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/views/durable_view_catalog.cpp b/src/mongo/db/views/durable_view_catalog.cpp
index 806e6e8d87e..d27b4384a59 100644
--- a/src/mongo/db/views/durable_view_catalog.cpp
+++ b/src/mongo/db/views/durable_view_catalog.cpp
@@ -111,7 +111,7 @@ void DurableViewCatalogImpl::_iterate(OperationContext* opCtx,
ViewCatalogLookupBehavior lookupBehavior) {
invariant(opCtx->lockState()->isCollectionLockedForMode(_db->getSystemViewsName(), MODE_IS));
- Collection* systemViews =
+ const Collection* systemViews =
CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, _db->getSystemViewsName());
if (!systemViews) {
return;
@@ -186,7 +186,7 @@ void DurableViewCatalogImpl::upsert(OperationContext* opCtx,
NamespaceString systemViewsNs(_db->getSystemViewsName());
dassert(opCtx->lockState()->isCollectionLockedForMode(systemViewsNs, MODE_X));
- Collection* systemViews =
+ const Collection* systemViews =
CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, systemViewsNs);
invariant(systemViews);
@@ -218,7 +218,7 @@ void DurableViewCatalogImpl::remove(OperationContext* opCtx, const NamespaceStri
dassert(opCtx->lockState()->isDbLockedForMode(_db->name(), MODE_IX));
dassert(opCtx->lockState()->isCollectionLockedForMode(name, MODE_IX));
- Collection* systemViews =
+ const Collection* systemViews =
CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, _db->getSystemViewsName());
dassert(opCtx->lockState()->isCollectionLockedForMode(systemViews->ns(), MODE_X));