From 00913e47de5aced5267e44e82ac9e976bbaac089 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Wed, 30 Jul 2014 17:34:46 -0400 Subject: SERVER-13951 Split index building in to UnitOfWork-sized stages All index builds now go through the MultiIndexBuilder as its API was already close to ideal. The following tickets have also been addressed by this commit: SERVER-14710 Remove dropDups SERVER-12309 Cloner build indexes in parallel SERVER-14737 Initial sync uses bg index building SERVER-9135 fast index build for initial sync SERVER-2747 can't kill index in phase 2 SERVER-8917 check error code rather than assuming all errors are dups SERVER-14820 compact enforces unique while claiming not to SERVER-14746 IndexRebuilder should be foreground and fail fatally --- src/mongo/dbtests/counttests.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/mongo/dbtests/counttests.cpp') diff --git a/src/mongo/dbtests/counttests.cpp b/src/mongo/dbtests/counttests.cpp index 879d4353a0e..b18fb31af79 100644 --- a/src/mongo/dbtests/counttests.cpp +++ b/src/mongo/dbtests/counttests.cpp @@ -31,6 +31,7 @@ #include #include "mongo/db/db.h" +#include "mongo/db/dbhelpers.h" #include "mongo/db/json.h" #include "mongo/db/commands/count.h" #include "mongo/db/catalog/collection.h" @@ -66,13 +67,11 @@ namespace CountTests { return "unittests.counttests"; } void addIndex( const BSONObj &key ) { - BSONObjBuilder b; - b.append( "name", key.firstElementFieldName() ); - b.append( "ns", ns() ); - b.append( "key", key ); - BSONObj o = b.done(); - Status s = _collection->getIndexCatalog()->createIndex(&_txn, o, false); - uassertStatusOK( s ); + Helpers::ensureIndex(&_txn, + _collection, + key, + /*unique=*/ false, + /*name=*/ key.firstElementFieldName()); } void insert( const char *s ) { insert( fromjson( s ) ); -- cgit v1.2.1