summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/query_stage_keep.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/dbtests/query_stage_keep.cpp')
-rw-r--r--src/mongo/dbtests/query_stage_keep.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/mongo/dbtests/query_stage_keep.cpp b/src/mongo/dbtests/query_stage_keep.cpp
index 782cc0eaf91..c5a57396987 100644
--- a/src/mongo/dbtests/query_stage_keep.cpp
+++ b/src/mongo/dbtests/query_stage_keep.cpp
@@ -60,14 +60,14 @@ using stdx::make_unique;
class QueryStageKeepBase {
public:
- QueryStageKeepBase() : _client(&_txn) {}
+ QueryStageKeepBase() : _client(&_opCtx) {}
virtual ~QueryStageKeepBase() {
_client.dropCollection(ns());
}
void getLocs(set<RecordId>* out, Collection* coll) {
- auto cursor = coll->getCursor(&_txn);
+ auto cursor = coll->getCursor(&_opCtx);
while (auto record = cursor->next()) {
out->insert(record->id);
}
@@ -98,7 +98,7 @@ public:
protected:
const ServiceContext::UniqueOperationContext _txnPtr = cc().makeOperationContext();
- OperationContext& _txn = *_txnPtr;
+ OperationContext& _opCtx = *_txnPtr;
DBDirectClient _client;
};
@@ -111,12 +111,12 @@ protected:
class KeepStageBasic : public QueryStageKeepBase {
public:
void run() {
- OldClientWriteContext ctx(&_txn, ns());
+ OldClientWriteContext ctx(&_opCtx, ns());
Database* db = ctx.db();
Collection* coll = db->getCollection(ns());
if (!coll) {
- WriteUnitOfWork wuow(&_txn);
- coll = db->createCollection(&_txn, ns());
+ WriteUnitOfWork wuow(&_opCtx);
+ coll = db->createCollection(&_opCtx, ns());
wuow.commit();
}
@@ -142,12 +142,12 @@ public:
params.direction = CollectionScanParams::FORWARD;
params.tailable = false;
params.start = RecordId();
- CollectionScan* cs = new CollectionScan(&_txn, params, &ws, NULL);
+ CollectionScan* cs = new CollectionScan(&_opCtx, params, &ws, NULL);
// Create a KeepMutations stage to merge in the 10 flagged objects.
// Takes ownership of 'cs'
MatchExpression* nullFilter = NULL;
- auto keep = make_unique<KeepMutationsStage>(&_txn, nullFilter, &ws, cs);
+ auto keep = make_unique<KeepMutationsStage>(&_opCtx, nullFilter, &ws, cs);
for (size_t i = 0; i < 10; ++i) {
WorkingSetID id = getNextResult(keep.get());
@@ -178,13 +178,13 @@ public:
class KeepStageFlagAdditionalAfterStreamingStarts : public QueryStageKeepBase {
public:
void run() {
- OldClientWriteContext ctx(&_txn, ns());
+ OldClientWriteContext ctx(&_opCtx, ns());
Database* db = ctx.db();
Collection* coll = db->getCollection(ns());
if (!coll) {
- WriteUnitOfWork wuow(&_txn);
- coll = db->createCollection(&_txn, ns());
+ WriteUnitOfWork wuow(&_opCtx);
+ coll = db->createCollection(&_opCtx, ns());
wuow.commit();
}
WorkingSet ws;
@@ -195,7 +195,8 @@ public:
// Create a KeepMutationsStage with an EOF child, and flag 50 objects. We expect these
// objects to be returned by the KeepMutationsStage.
MatchExpression* nullFilter = NULL;
- auto keep = make_unique<KeepMutationsStage>(&_txn, nullFilter, &ws, new EOFStage(&_txn));
+ auto keep =
+ make_unique<KeepMutationsStage>(&_opCtx, nullFilter, &ws, new EOFStage(&_opCtx));
for (size_t i = 0; i < 50; ++i) {
WorkingSetID id = ws.allocate();
WorkingSetMember* member = ws.get(id);