diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2018-02-04 09:01:03 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2018-02-14 17:12:44 -0500 |
commit | e5e8dde676b585f5620608e95e93b9da295890c5 (patch) | |
tree | 15682c345e91499c4a4818214e881d3ffab00d08 /src/mongo/db/namespace_string.h | |
parent | 4d18e6908acc852c77e97df0bf169c442a9bb306 (diff) | |
download | mongo-e5e8dde676b585f5620608e95e93b9da295890c5.tar.gz |
SERVER-32367 Clean up the AutoGet* suite of classes
* Get rid of AutoGetCollectionOrViewForReadCommand
* Get rid of constructors accepting Lock::DBLock
* Always check for shard version, unless the namespace represents a view
Diffstat (limited to 'src/mongo/db/namespace_string.h')
-rw-r--r-- | src/mongo/db/namespace_string.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/mongo/db/namespace_string.h b/src/mongo/db/namespace_string.h index eb19a5dfb04..6a1ab881700 100644 --- a/src/mongo/db/namespace_string.h +++ b/src/mongo/db/namespace_string.h @@ -449,22 +449,15 @@ private: */ class NamespaceStringOrUUID { public: - struct DBNameAndUUID { - std::string dbName; - UUID uuid; - }; - NamespaceStringOrUUID(NamespaceString nss) : _nss(std::move(nss)) {} - NamespaceStringOrUUID(StringData dbName, UUID uuid) : _dbAndUUID({dbName.toString(), uuid}) {} - - StringData db() const; + NamespaceStringOrUUID(UUID uuid) : _uuid(std::move(uuid)) {} const boost::optional<NamespaceString>& nss() const { return _nss; } - const boost::optional<DBNameAndUUID>& dbAndUUID() const { - return _dbAndUUID; + const boost::optional<UUID>& uuid() const { + return _uuid; } std::string toString() const; @@ -472,7 +465,7 @@ public: private: // At any given time exactly one of these optionals will be initialized boost::optional<NamespaceString> _nss; - boost::optional<DBNameAndUUID> _dbAndUUID; + boost::optional<UUID> _uuid; }; std::ostream& operator<<(std::ostream& stream, const NamespaceString& nss); |