diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-08-22 15:24:07 -0400 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-08-22 18:08:33 -0400 |
commit | a623921d9cac3305dc40927b712969aafed4c5f9 (patch) | |
tree | 5d8c68a9972e4bff892c721594274d797a202cbd /src/mongo/db/catalog/index_consistency.h | |
parent | f8a233744b5e39c802ddd42c51d2e707f0c57bbe (diff) | |
download | mongo-a623921d9cac3305dc40927b712969aafed4c5f9.tar.gz |
SERVER-42966 Remove references from helper classes for collection validation to simplify re-locking logic
Diffstat (limited to 'src/mongo/db/catalog/index_consistency.h')
-rw-r--r-- | src/mongo/db/catalog/index_consistency.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/mongo/db/catalog/index_consistency.h b/src/mongo/db/catalog/index_consistency.h index df03c3c129b..8eab32e3b3b 100644 --- a/src/mongo/db/catalog/index_consistency.h +++ b/src/mongo/db/catalog/index_consistency.h @@ -29,21 +29,23 @@ #pragma once -#include "mongo/db/concurrency/d_concurrency.h" -#include "mongo/db/index/index_descriptor.h" +#include "mongo/bson/simple_bsonobj_comparator.h" #include "mongo/db/storage/key_string.h" #include "mongo/db/storage/record_store.h" -#include "mongo/db/storage/sorted_data_interface.h" -#include "mongo/util/elapsed_tracker.h" namespace mongo { +class IndexDescriptor; + /** * Contains all the index information and stats throughout the validation. */ struct IndexInfo { IndexInfo(const IndexDescriptor* descriptor); - const IndexDescriptor* const descriptor; + // Index name. + const std::string indexName; + // Contains the indexes key pattern. + const BSONObj keyPattern; // Contains the pre-computed hash of the index name. const uint32_t indexNameHash; // More efficient representation of the ordering of the descriptor's key pattern. @@ -71,10 +73,7 @@ class IndexConsistency final { using ValidateResultsMap = std::map<std::string, ValidateResults>; public: - IndexConsistency(OperationContext* opCtx, - Collection* collection, - NamespaceString nss, - bool background); + IndexConsistency(OperationContext* opCtx, Collection* coll); /** * During the first phase of validation, given the document's key KeyString, increment the @@ -140,11 +139,6 @@ public: private: IndexConsistency() = delete; - OperationContext* _opCtx; - Collection* _collection; - const NamespaceString _nss; - ElapsedTracker _tracker; - // We map the hashed KeyString values to a bucket that contains the count of how many // index keys and document keys we've seen in each bucket. This counter is unsigned to avoid // undefined behavior in the (unlikely) case of overflow. |