From b69aed9d10ef66de42880fd379b0a593419b6e47 Mon Sep 17 00:00:00 2001 From: Daniel Gottlieb Date: Fri, 5 May 2017 15:23:14 -0400 Subject: SERVER-28742: Assign prefixes to collections/indexes when --groupCollections is engaged --- src/mongo/db/storage/bson_collection_catalog_entry.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/storage/bson_collection_catalog_entry.h') diff --git a/src/mongo/db/storage/bson_collection_catalog_entry.h b/src/mongo/db/storage/bson_collection_catalog_entry.h index f2dbd891dd7..8806829cd0b 100644 --- a/src/mongo/db/storage/bson_collection_catalog_entry.h +++ b/src/mongo/db/storage/bson_collection_catalog_entry.h @@ -35,6 +35,7 @@ #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/index/multikey_paths.h" +#include "mongo/db/storage/kv/kv_prefix.h" namespace mongo { @@ -66,12 +67,14 @@ public: virtual bool isIndexReady(OperationContext* opCtx, StringData indexName) const; + virtual KVPrefix getIndexPrefix(OperationContext* opCtx, StringData indexName) const; + // ------ for implementors struct IndexMetaData { IndexMetaData() {} - IndexMetaData(BSONObj s, bool r, RecordId h, bool m) - : spec(s), ready(r), head(h), multikey(m) {} + IndexMetaData(BSONObj s, bool r, RecordId h, bool m, KVPrefix prefix) + : spec(s), ready(r), head(h), multikey(m), prefix(prefix) {} void updateTTLSetting(long long newExpireSeconds); @@ -83,6 +86,7 @@ public: bool ready; RecordId head; bool multikey; + KVPrefix prefix = KVPrefix::kNotPrefixed; // If non-empty, 'multikeyPaths' is a vector with size equal to the number of elements in // the index key pattern. Each element in the vector is an ordered set of positions @@ -105,9 +109,12 @@ public: void rename(StringData toNS); + KVPrefix getMaxPrefix() const; + std::string ns; CollectionOptions options; std::vector indexes; + KVPrefix prefix = KVPrefix::kNotPrefixed; }; protected: -- cgit v1.2.1