diff options
author | Maria van Keulen <maria@mongodb.com> | 2017-03-07 12:00:08 -0500 |
---|---|---|
committer | Maria van Keulen <maria@mongodb.com> | 2017-03-07 12:00:08 -0500 |
commit | 589a5c169ced8f6e9ddcd3d182ae1b75db6b7d79 (patch) | |
tree | c7a090ffdd56a91ae677e2492c61b820af44f964 /src/mongo/dbtests/query_stage_tests.cpp | |
parent | 3cba97198638df3750e3b455e2ad57af7ee536ae (diff) | |
download | mongo-589a5c169ced8f6e9ddcd3d182ae1b75db6b7d79.tar.gz |
SERVER-27938 Rename all OperationContext variables to opCtx
This commit is an automated rename of all whole word instances of txn,
_txn, and txnPtr to opCtx, _opCtx, and opCtxPtr, respectively in all
.cpp and .h files in src/mongo.
Diffstat (limited to 'src/mongo/dbtests/query_stage_tests.cpp')
-rw-r--r-- | src/mongo/dbtests/query_stage_tests.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mongo/dbtests/query_stage_tests.cpp b/src/mongo/dbtests/query_stage_tests.cpp index 276b9005b3c..55326de7c63 100644 --- a/src/mongo/dbtests/query_stage_tests.cpp +++ b/src/mongo/dbtests/query_stage_tests.cpp @@ -54,8 +54,8 @@ using std::unique_ptr; class IndexScanBase { public: - IndexScanBase() : _client(&_txn) { - OldClientWriteContext ctx(&_txn, ns()); + IndexScanBase() : _client(&_opCtx) { + OldClientWriteContext ctx(&_opCtx, ns()); for (int i = 0; i < numObj(); ++i) { BSONObjBuilder bob; @@ -70,16 +70,16 @@ public: } virtual ~IndexScanBase() { - OldClientWriteContext ctx(&_txn, ns()); + OldClientWriteContext ctx(&_opCtx, ns()); _client.dropCollection(ns()); } void addIndex(const BSONObj& obj) { - ASSERT_OK(dbtests::createIndex(&_txn, ns(), obj)); + ASSERT_OK(dbtests::createIndex(&_opCtx, ns(), obj)); } int countResults(const IndexScanParams& params, BSONObj filterObj = BSONObj()) { - AutoGetCollectionForRead ctx(&_txn, NamespaceString(ns())); + AutoGetCollectionForRead ctx(&_opCtx, NamespaceString(ns())); const CollatorInterface* collator = nullptr; StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse( @@ -89,10 +89,10 @@ public: unique_ptr<WorkingSet> ws = stdx::make_unique<WorkingSet>(); unique_ptr<IndexScan> ix = - stdx::make_unique<IndexScan>(&_txn, params, ws.get(), filterExpr.get()); + stdx::make_unique<IndexScan>(&_opCtx, params, ws.get(), filterExpr.get()); auto statusWithPlanExecutor = PlanExecutor::make( - &_txn, std::move(ws), std::move(ix), ctx.getCollection(), PlanExecutor::YIELD_MANUAL); + &_opCtx, std::move(ws), std::move(ix), ctx.getCollection(), PlanExecutor::YIELD_MANUAL); ASSERT_OK(statusWithPlanExecutor.getStatus()); unique_ptr<PlanExecutor> exec = std::move(statusWithPlanExecutor.getValue()); @@ -107,7 +107,7 @@ public: } void makeGeoData() { - OldClientWriteContext ctx(&_txn, ns()); + OldClientWriteContext ctx(&_opCtx, ns()); for (int i = 0; i < numObj(); ++i) { double lat = double(rand()) / RAND_MAX; @@ -117,10 +117,10 @@ public: } IndexDescriptor* getIndex(const BSONObj& obj) { - AutoGetCollectionForRead ctx(&_txn, NamespaceString(ns())); + AutoGetCollectionForRead ctx(&_opCtx, NamespaceString(ns())); Collection* collection = ctx.getCollection(); std::vector<IndexDescriptor*> indexes; - collection->getIndexCatalog()->findIndexesByKeyPattern(&_txn, obj, false, &indexes); + collection->getIndexCatalog()->findIndexesByKeyPattern(&_opCtx, obj, false, &indexes); return indexes.empty() ? nullptr : indexes[0]; } @@ -133,7 +133,7 @@ public: protected: const ServiceContext::UniqueOperationContext _txnPtr = cc().makeOperationContext(); - OperationContext& _txn = *_txnPtr; + OperationContext& _opCtx = *_txnPtr; private: DBDirectClient _client; |