diff options
author | Mathias Stearn <mathias@10gen.com> | 2014-07-30 17:34:46 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2014-08-13 17:30:25 -0400 |
commit | 00913e47de5aced5267e44e82ac9e976bbaac089 (patch) | |
tree | 26002b9f1eb4e7b3f295bd2a4cf24a68aa13cad3 /src/mongo/dbtests/counttests.cpp | |
parent | c610cfe5c58d1f4301f5535d3e166d5d4332bc87 (diff) | |
download | mongo-00913e47de5aced5267e44e82ac9e976bbaac089.tar.gz |
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
Diffstat (limited to 'src/mongo/dbtests/counttests.cpp')
-rw-r--r-- | src/mongo/dbtests/counttests.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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 <boost/thread/thread.hpp> #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 ) ); |