summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/explain_cmd.cpp
diff options
context:
space:
mode:
authorMaria van Keulen <maria@mongodb.com>2017-03-07 12:00:08 -0500
committerMaria van Keulen <maria@mongodb.com>2017-03-07 12:00:08 -0500
commit589a5c169ced8f6e9ddcd3d182ae1b75db6b7d79 (patch)
treec7a090ffdd56a91ae677e2492c61b820af44f964 /src/mongo/db/commands/explain_cmd.cpp
parent3cba97198638df3750e3b455e2ad57af7ee536ae (diff)
downloadmongo-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/db/commands/explain_cmd.cpp')
-rw-r--r--src/mongo/db/commands/explain_cmd.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp
index 678fd7effa2..7c72c26977f 100644
--- a/src/mongo/db/commands/explain_cmd.cpp
+++ b/src/mongo/db/commands/explain_cmd.cpp
@@ -89,7 +89,7 @@ public:
* the command that you are explaining. The auth check is performed recursively
* on the nested command.
*/
- virtual Status checkAuthForOperation(OperationContext* txn,
+ virtual Status checkAuthForOperation(OperationContext* opCtx,
const std::string& dbname,
const BSONObj& cmdObj) {
if (Object != cmdObj.firstElement().type()) {
@@ -105,10 +105,10 @@ public:
return Status(ErrorCodes::CommandNotFound, ss);
}
- return commToExplain->checkAuthForOperation(txn, dbname, explainObj);
+ return commToExplain->checkAuthForOperation(opCtx, dbname, explainObj);
}
- virtual bool run(OperationContext* txn,
+ virtual bool run(OperationContext* opCtx,
const std::string& dbname,
BSONObj& cmdObj,
int options,
@@ -135,12 +135,12 @@ public:
// copied from Command::execCommand and should be abstracted. Until then, make
// sure to keep it up to date.
repl::ReplicationCoordinator* replCoord = repl::getGlobalReplicationCoordinator();
- bool iAmPrimary = replCoord->canAcceptWritesForDatabase_UNSAFE(txn, dbname);
+ bool iAmPrimary = replCoord->canAcceptWritesForDatabase_UNSAFE(opCtx, dbname);
bool commandCanRunOnSecondary = commToExplain->slaveOk();
bool commandIsOverriddenToRunOnSecondary = commToExplain->slaveOverrideOk() &&
- rpc::ServerSelectionMetadata::get(txn).canRunOnSecondary();
- bool iAmStandalone = !txn->writesAreReplicated();
+ rpc::ServerSelectionMetadata::get(opCtx).canRunOnSecondary();
+ bool iAmStandalone = !opCtx->writesAreReplicated();
const bool canRunHere = iAmPrimary || commandCanRunOnSecondary ||
commandIsOverriddenToRunOnSecondary || iAmStandalone;
@@ -154,8 +154,12 @@ public:
}
// Actually call the nested command's explain(...) method.
- Status explainStatus = commToExplain->explain(
- txn, dbname, explainObj, verbosity, rpc::ServerSelectionMetadata::get(txn), &result);
+ Status explainStatus = commToExplain->explain(opCtx,
+ dbname,
+ explainObj,
+ verbosity,
+ rpc::ServerSelectionMetadata::get(opCtx),
+ &result);
if (!explainStatus.isOK()) {
return appendCommandStatus(result, explainStatus);
}