diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-07-09 04:15:56 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-07-18 15:16:15 -0400 |
commit | 9066a06214f115c182c2b83ed40e939e05b9c1f8 (patch) | |
tree | 4239137f6521f1d1d77ecc3c3be89b6e6779f7f1 /src/mongo/db/ops/delete_executor.cpp | |
parent | 3c3d656668e26645492ee3dafb241631352426d4 (diff) | |
download | mongo-9066a06214f115c182c2b83ed40e939e05b9c1f8.tar.gz |
SERVER-13961 Pass OperationContext into WhereCallbackReal
There are no functional changes in this commit, just preparation for the
subsequent one, which will add operation context to the JS execution
scope.
Diffstat (limited to 'src/mongo/db/ops/delete_executor.cpp')
-rw-r--r-- | src/mongo/db/ops/delete_executor.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/mongo/db/ops/delete_executor.cpp b/src/mongo/db/ops/delete_executor.cpp index e7eb2a9546c..d2c36f3ba3c 100644 --- a/src/mongo/db/ops/delete_executor.cpp +++ b/src/mongo/db/ops/delete_executor.cpp @@ -66,7 +66,8 @@ namespace mongo { } CanonicalQuery* cqRaw; - const WhereCallbackReal whereCallback(_request->getNamespaceString().db()); + const WhereCallbackReal whereCallback( + _request->getOpCtx(), _request->getNamespaceString().db()); Status status = CanonicalQuery::canonicalize(_request->getNamespaceString().ns(), _request->getQuery(), @@ -80,7 +81,7 @@ namespace mongo { return status; } - long long DeleteExecutor::execute(OperationContext* txn, Database* db) { + long long DeleteExecutor::execute(Database* db) { uassertStatusOK(prepare()); uassert(17417, mongoutils::str::stream() << @@ -100,7 +101,7 @@ namespace mongo { } } - Collection* collection = db->getCollection(txn, ns.ns()); + Collection* collection = db->getCollection(_request->getOpCtx(), ns.ns()); if (NULL == collection) { return 0; } @@ -118,11 +119,14 @@ namespace mongo { Runner* rawRunner; if (_canonicalQuery.get()) { - uassertStatusOK(getRunner(txn, collection, _canonicalQuery.release(), &rawRunner)); + uassertStatusOK(getRunner(_request->getOpCtx(), + collection, + _canonicalQuery.release(), + &rawRunner)); } else { CanonicalQuery* ignored; - uassertStatusOK(getRunner(txn, + uassertStatusOK(getRunner(_request->getOpCtx(), collection, ns.ns(), _request->getQuery(), @@ -135,7 +139,7 @@ namespace mongo { DiskLoc rloc; Runner::RunnerState state; - CurOp* curOp = txn->getCurOp(); + CurOp* curOp = _request->getOpCtx()->getCurOp(); int oldYieldCount = curOp->numYields(); while (Runner::RUNNER_ADVANCED == (state = runner->getNext(NULL, &rloc))) { if (oldYieldCount != curOp->numYields()) { @@ -151,8 +155,9 @@ namespace mongo { // TODO: do we want to buffer docs and delete them in a group rather than // saving/restoring state repeatedly? runner->saveState(); - collection->deleteDocument(txn, rloc, false, false, logop ? &toDelete : NULL ); - runner->restoreState(txn); + collection->deleteDocument( + _request->getOpCtx(), rloc, false, false, logop ? &toDelete : NULL); + runner->restoreState(_request->getOpCtx()); nDeleted++; @@ -163,7 +168,8 @@ namespace mongo { } else { bool replJustOne = true; - repl::logOp(txn, "d", ns.ns().c_str(), toDelete, 0, &replJustOne); + repl::logOp( + _request->getOpCtx(), "d", ns.ns().c_str(), toDelete, 0, &replJustOne); } } @@ -172,7 +178,7 @@ namespace mongo { } if (!_request->isGod()) { - txn->recoveryUnit()->commitIfNeeded(); + _request->getOpCtx()->recoveryUnit()->commitIfNeeded(); } if (debug && _request->isGod() && nDeleted == 100) { |