summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/collection_catalog_entry.h
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2016-05-08 14:16:24 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2016-05-08 14:16:24 -0400
commit3a0d6ee6a2b6f82c5775380b7184501916338331 (patch)
treeeeb564a87bbd7b285392499cbfa01d179ff67d52 /src/mongo/db/catalog/collection_catalog_entry.h
parent65222c4b5146cc6b8930e784149e5aade132a8fc (diff)
downloadmongo-3a0d6ee6a2b6f82c5775380b7184501916338331.tar.gz
SERVER-22726 Store path-level multikey information in the KVCatalog.
Diffstat (limited to 'src/mongo/db/catalog/collection_catalog_entry.h')
-rw-r--r--src/mongo/db/catalog/collection_catalog_entry.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/mongo/db/catalog/collection_catalog_entry.h b/src/mongo/db/catalog/collection_catalog_entry.h
index a31843b3cce..dd6a1f506f1 100644
--- a/src/mongo/db/catalog/collection_catalog_entry.h
+++ b/src/mongo/db/catalog/collection_catalog_entry.h
@@ -32,6 +32,7 @@
#include "mongo/base/string_data.h"
#include "mongo/db/catalog/collection_options.h"
+#include "mongo/db/index/multikey_paths.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/record_id.h"
@@ -63,11 +64,33 @@ public:
virtual BSONObj getIndexSpec(OperationContext* txn, StringData idxName) const = 0;
- virtual bool isIndexMultikey(OperationContext* txn, StringData indexName) const = 0;
+ /**
+ * Returns true if the index identified by 'indexName' is multikey, and returns false otherwise.
+ *
+ * If the 'multikeyPaths' pointer is non-null, then it must point to an empty vector. If this
+ * index supports tracking path-level multikey information, then this function sets
+ * 'multikeyPaths' as the path components that cause this index to be multikey.
+ *
+ * In particular, if this function returns false and the index supports tracking path-level
+ * multikey information, then 'multikeyPaths' is initialized as a vector with size equal to the
+ * number of elements in the index key pattern of empty sets.
+ */
+ virtual bool isIndexMultikey(OperationContext* txn,
+ StringData indexName,
+ MultikeyPaths* multikeyPaths) const = 0;
+ /**
+ * Sets the index identified by 'indexName' to be multikey.
+ *
+ * If 'multikeyPaths' is non-empty, then it must be a vector with size equal to the number of
+ * elements in the index key pattern. Additionally, at least one path component of the indexed
+ * fields must cause this index to be multikey.
+ *
+ * This function returns true if the index metadata has changed, and returns false otherwise.
+ */
virtual bool setIndexIsMultikey(OperationContext* txn,
StringData indexName,
- bool multikey = true) = 0;
+ const MultikeyPaths& multikeyPaths) = 0;
virtual RecordId getIndexHead(OperationContext* txn, StringData indexName) const = 0;