summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/dbhash.cpp
diff options
context:
space:
mode:
authorXiangyu Yao <xiangyu.yao@mongodb.com>2019-06-19 00:38:36 -0400
committerXiangyu Yao <xiangyu.yao@mongodb.com>2019-06-28 15:03:00 -0400
commit2597e7fbe3c09683408b82b8b854023d6c2dbbf2 (patch)
tree8cfe4373adec95180cd2a1c37f428626bab94bfc /src/mongo/db/commands/dbhash.cpp
parent47ee8f8cde1d1e116caf223458c15b4af10943d6 (diff)
downloadmongo-2597e7fbe3c09683408b82b8b854023d6c2dbbf2.tar.gz
SERVER-40717 Remove CollectionCatalogEntry and KVColletionCatalogEntry
Diffstat (limited to 'src/mongo/db/commands/dbhash.cpp')
-rw-r--r--src/mongo/db/commands/dbhash.cpp75
1 files changed, 35 insertions, 40 deletions
diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp
index b24fcc3fd45..473b323f6b5 100644
--- a/src/mongo/db/commands/dbhash.cpp
+++ b/src/mongo/db/commands/dbhash.cpp
@@ -228,55 +228,50 @@ public:
std::set<std::string> cappedCollectionSet;
bool noError = true;
- catalog::forEachCollectionFromDb(
- opCtx,
- dbname,
- MODE_IS,
- [&](const Collection* collection, const CollectionCatalogEntry* catalogEntry) {
- auto collNss = collection->ns();
-
- if (collNss.size() - 1 <= dbname.size()) {
- errmsg = str::stream() << "weird fullCollectionName [" << collNss.toString()
- << "]";
- noError = false;
- return false;
- }
+ catalog::forEachCollectionFromDb(opCtx, dbname, MODE_IS, [&](const Collection* collection) {
+ auto collNss = collection->ns();
- // Only include 'system' collections that are replicated.
- bool isReplicatedSystemColl =
- (replicatedSystemCollections.count(collNss.coll().toString()) > 0);
- if (collNss.isSystem() && !isReplicatedSystemColl)
- return true;
+ if (collNss.size() - 1 <= dbname.size()) {
+ errmsg = str::stream() << "weird fullCollectionName [" << collNss.toString() << "]";
+ noError = false;
+ return false;
+ }
- if (collNss.coll().startsWith("tmp.mr.")) {
- // We skip any incremental map reduce collections as they also aren't
- // replicated.
- return true;
- }
+ // Only include 'system' collections that are replicated.
+ bool isReplicatedSystemColl =
+ (replicatedSystemCollections.count(collNss.coll().toString()) > 0);
+ if (collNss.isSystem() && !isReplicatedSystemColl)
+ return true;
- if (desiredCollections.size() > 0 &&
- desiredCollections.count(collNss.coll().toString()) == 0)
- return true;
+ if (collNss.coll().startsWith("tmp.mr.")) {
+ // We skip any incremental map reduce collections as they also aren't
+ // replicated.
+ return true;
+ }
- // Don't include 'drop pending' collections.
- if (collNss.isDropPendingNamespace())
- return true;
+ if (desiredCollections.size() > 0 &&
+ desiredCollections.count(collNss.coll().toString()) == 0)
+ return true;
- if (collection->isCapped()) {
- cappedCollectionSet.insert(collNss.coll().toString());
- }
+ // Don't include 'drop pending' collections.
+ if (collNss.isDropPendingNamespace())
+ return true;
- if (OptionalCollectionUUID uuid = collection->uuid()) {
- collectionToUUIDMap[collNss.coll().toString()] = uuid;
- }
+ if (collection->isCapped()) {
+ cappedCollectionSet.insert(collNss.coll().toString());
+ }
- // Compute the hash for this collection.
- std::string hash = _hashCollection(opCtx, db, collNss);
+ if (OptionalCollectionUUID uuid = collection->uuid()) {
+ collectionToUUIDMap[collNss.coll().toString()] = uuid;
+ }
- collectionToHashMap[collNss.coll().toString()] = hash;
+ // Compute the hash for this collection.
+ std::string hash = _hashCollection(opCtx, db, collNss);
- return true;
- });
+ collectionToHashMap[collNss.coll().toString()] = hash;
+
+ return true;
+ });
if (!noError)
return false;