summaryrefslogtreecommitdiff
path: root/src/mongo/db/index.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/index.h')
-rw-r--r--src/mongo/db/index.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mongo/db/index.h b/src/mongo/db/index.h
index b4e093da12b..a522d58a906 100644
--- a/src/mongo/db/index.h
+++ b/src/mongo/db/index.h
@@ -261,5 +261,27 @@ namespace mongo {
void assureSysIndexesEmptied(const char *ns, IndexDetails *exceptForIdIndex);
int removeFromSysIndexes(const char *ns, const char *idxName);
+ /**
+ * Prepare to build an index. Does not actually build it (except for a special _id case).
+ * - We validate that the params are good
+ * - That the index does not already exist
+ * - Creates the source collection if it DNE
+ *
+ * example of 'io':
+ * { ns : 'test.foo', name : 'z', key : { z : 1 } }
+ *
+ * @throws DBException
+ *
+ * @param mayInterrupt - When true, killop may interrupt the function call.
+ * @param sourceNS - source NS we are indexing
+ * @param sourceCollection - its details ptr
+ * @return true if ok to continue. when false we stop/fail silently (index already exists)
+ */
+ bool prepareToBuildIndex(const BSONObj& io,
+ bool mayInterrupt,
+ bool god,
+ string& sourceNS,
+ NamespaceDetails*& sourceCollection,
+ BSONObj& fixedIndexObject);
} // namespace mongo