diff options
author | Benety Goh <benety@mongodb.com> | 2019-01-24 13:09:38 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2019-01-24 13:09:38 -0500 |
commit | 057223f7315fe6fc9a248eb252e113fc2af50199 (patch) | |
tree | 364a2182a48a683c54f85c834c634fff116a37d7 /src/mongo/db/catalog/rename_collection.cpp | |
parent | 15ad2f665d4de58e6af45f237b050976a3da34e8 (diff) | |
download | mongo-057223f7315fe6fc9a248eb252e113fc2af50199.tar.gz |
SERVER-39032 remove unnecessary NamespaceString::ns() calls from db/catalog/
Diffstat (limited to 'src/mongo/db/catalog/rename_collection.cpp')
-rw-r--r-- | src/mongo/db/catalog/rename_collection.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/mongo/db/catalog/rename_collection.cpp b/src/mongo/db/catalog/rename_collection.cpp index c0bb212b6dd..a6b71b91e7d 100644 --- a/src/mongo/db/catalog/rename_collection.cpp +++ b/src/mongo/db/catalog/rename_collection.cpp @@ -87,15 +87,15 @@ Status renameTargetCollectionToTmp(OperationContext* opCtx, if (!tmpNameResult.isOK()) { return tmpNameResult.getStatus().withContext( str::stream() << "Cannot generate a temporary collection name for the target " - << targetNs.ns() + << targetNs << " (" << targetUUID << ") so that the source" - << sourceNs.ns() + << sourceNs << " (" << sourceUUID << ") could be renamed to " - << targetNs.ns()); + << targetNs); } const auto& tmpName = tmpNameResult.getValue(); const bool stayTemp = true; @@ -107,9 +107,9 @@ Status renameTargetCollectionToTmp(OperationContext* opCtx, wunit.commit(); - log() << "Successfully renamed the target " << targetNs.ns() << " (" << targetUUID - << ") to " << tmpName << " so that the source " << sourceNs.ns() << " (" << sourceUUID - << ") could be renamed to " << targetNs.ns(); + log() << "Successfully renamed the target " << targetNs << " (" << targetUUID << ") to " + << tmpName << " so that the source " << sourceNs << " (" << sourceUUID + << ") could be renamed to " << targetNs; return Status::OK(); }); @@ -150,9 +150,8 @@ Status renameCollectionCommon(OperationContext* opCtx, if (userInitiatedWritesAndNotPrimary) { return Status(ErrorCodes::NotMaster, - str::stream() << "Not primary while renaming collection " << source.ns() - << " to " - << target.ns()); + str::stream() << "Not primary while renaming collection " << source << " to " + << target); } auto databaseHolder = DatabaseHolder::get(opCtx); @@ -164,7 +163,7 @@ Status renameCollectionCommon(OperationContext* opCtx, if (!sourceColl) { if (sourceDB && sourceDB->getViewCatalog()->lookup(opCtx, source.ns())) return Status(ErrorCodes::CommandNotSupportedOnView, - str::stream() << "cannot rename view: " << source.ns()); + str::stream() << "cannot rename view: " << source); return Status(ErrorCodes::NamespaceNotFound, "source namespace does not exist"); } @@ -238,7 +237,7 @@ Status renameCollectionCommon(OperationContext* opCtx, } } else if (targetDB->getViewCatalog()->lookup(opCtx, target.ns())) { return Status(ErrorCodes::NamespaceExists, - str::stream() << "a view already exists with that name: " << target.ns()); + str::stream() << "a view already exists with that name: " << target); } // When reapplying oplog entries (such as in the case of initial sync) we need @@ -377,9 +376,9 @@ Status renameCollectionCommon(OperationContext* opCtx, targetDB->makeUniqueCollectionNamespace(opCtx, "tmp%%%%%.renameCollection"); if (!tmpNameResult.isOK()) { return tmpNameResult.getStatus().withContext( - str::stream() << "Cannot generate temporary collection name to rename " << source.ns() + str::stream() << "Cannot generate temporary collection name to rename " << source << " to " - << target.ns()); + << target); } const auto& tmpName = tmpNameResult.getValue(); |