diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2017-06-15 00:17:19 -0400 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2017-06-15 00:17:19 -0400 |
commit | 59ea14f97808e343a4a10a1b5352b7096b695e38 (patch) | |
tree | dfd0d9b7b04819f7e321ad8c63ac4971be85d5a8 /src/mongo/db/db_raii.h | |
parent | 3ac29e19745e4a594bff892f3de8372159770565 (diff) | |
download | mongo-59ea14f97808e343a4a10a1b5352b7096b695e38.tar.gz |
Revert "SERVER-29417 Attach logical session ids to cursors"
This reverts commit 65828661c6579989fdbb43f2c21de16f2bf72586.
Diffstat (limited to 'src/mongo/db/db_raii.h')
-rw-r--r-- | src/mongo/db/db_raii.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/mongo/db/db_raii.h b/src/mongo/db/db_raii.h index 641b64e7988..753909e3c6a 100644 --- a/src/mongo/db/db_raii.h +++ b/src/mongo/db/db_raii.h @@ -128,55 +128,12 @@ private: const Lock::CollectionLock _collLock; Collection* const _coll; - friend class AutoGetCollectionOrView; friend class AutoGetCollectionForRead; friend class AutoGetCollectionForReadCommand; friend class AutoGetCollectionOrViewForReadCommand; }; /** - * RAII-style class which acquires the appropriate hierarchy of locks for a collection or - * view. The pointer to a view definition is nullptr if it does not exist. - * - * Use this when you have not yet determined if the namespace is a view or a collection. - * For example, you can use this to access a namespace's CursorManager. - * - * It is guaranteed that locks will be released when this object goes out of scope, therefore - * the view returned by this class should not be retained. - */ -class AutoGetCollectionOrView { - MONGO_DISALLOW_COPYING(AutoGetCollectionOrView); - -public: - AutoGetCollectionOrView(OperationContext* opCtx, const NamespaceString& nss, LockMode modeAll); - - /** - * Returns nullptr if the database didn't exist. - */ - Database* getDb() const { - return _autoColl.getDb(); - } - - /** - * Returns nullptr if the collection didn't exist. - */ - Collection* getCollection() const { - return _autoColl.getCollection(); - } - - /** - * Returns nullptr if the view didn't exist. - */ - ViewDefinition* getView() const { - return _view.get(); - } - -private: - const AutoGetCollection _autoColl; - std::shared_ptr<ViewDefinition> _view; -}; - -/** * RAII-style class, which acquires a lock on the specified database in the requested mode and * obtains a reference to the database, creating it was non-existing. Used as a shortcut for * calls to dbHolder().openDb(), taking care of locking details. The requested mode must be |