summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/bson_collection_catalog_entry.h
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@10gen.com>2017-05-05 15:23:14 -0400
committerDaniel Gottlieb <daniel.gottlieb@10gen.com>2017-05-15 14:06:46 -0400
commitb69aed9d10ef66de42880fd379b0a593419b6e47 (patch)
tree26afd158f751c711682ab801ff028e562b4503af /src/mongo/db/storage/bson_collection_catalog_entry.h
parentc31686212e0011909bbe13f8740fe4f45b8117ef (diff)
downloadmongo-b69aed9d10ef66de42880fd379b0a593419b6e47.tar.gz
SERVER-28742: Assign prefixes to collections/indexes when --groupCollections is engaged
Diffstat (limited to 'src/mongo/db/storage/bson_collection_catalog_entry.h')
-rw-r--r--src/mongo/db/storage/bson_collection_catalog_entry.h11
1 files changed, 9 insertions, 2 deletions
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<IndexMetaData> indexes;
+ KVPrefix prefix = KVPrefix::kNotPrefixed;
};
protected: