summaryrefslogtreecommitdiff
path: root/src/mongo/db/index.h
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2012-10-25 14:07:23 -0700
committerAaron <aaron@10gen.com>2012-11-08 16:32:38 -0800
commit6a51b6b01e4ebdd723e6ad33f07934d5558f9ad7 (patch)
tree28bcdb963e99f213a281148a53b3c801c5fb41d8 /src/mongo/db/index.h
parentf5d6b28def1f23def5cd1ba551f5dc73277407ff (diff)
downloadmongo-6a51b6b01e4ebdd723e6ad33f07934d5558f9ad7.tar.gz
SERVER-3067 Add killop support for foreground index builds.
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