From 6a51b6b01e4ebdd723e6ad33f07934d5558f9ad7 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 25 Oct 2012 14:07:23 -0700 Subject: SERVER-3067 Add killop support for foreground index builds. --- src/mongo/db/index.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/mongo/db/index.h') 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 -- cgit v1.2.1