summaryrefslogtreecommitdiff
path: root/src/mongo/s/client/shard.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/s/client/shard.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/s/client/shard.cpp')
-rw-r--r--src/mongo/s/client/shard.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mongo/s/client/shard.cpp b/src/mongo/s/client/shard.cpp
index be61c500604..0702cdc91a5 100644
--- a/src/mongo/s/client/shard.cpp
+++ b/src/mongo/s/client/shard.cpp
@@ -110,27 +110,27 @@ bool Shard::isConfig() const {
return _id == "config";
}
-StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* txn,
+StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* opCtx,
const ReadPreferenceSetting& readPref,
const std::string& dbName,
const BSONObj& cmdObj,
RetryPolicy retryPolicy) {
- return runCommand(txn, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy);
+ return runCommand(opCtx, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy);
}
-StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* txn,
+StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* opCtx,
const ReadPreferenceSetting& readPref,
const std::string& dbName,
const BSONObj& cmdObj,
Milliseconds maxTimeMSOverride,
RetryPolicy retryPolicy) {
while (true) {
- auto interruptStatus = txn->checkForInterruptNoAssert();
+ auto interruptStatus = opCtx->checkForInterruptNoAssert();
if (!interruptStatus.isOK()) {
return interruptStatus;
}
- auto hostWithResponse = _runCommand(txn, readPref, dbName, maxTimeMSOverride, cmdObj);
+ auto hostWithResponse = _runCommand(opCtx, readPref, dbName, maxTimeMSOverride, cmdObj);
auto swCmdResponse = std::move(hostWithResponse.commandResponse);
auto commandStatus = _getEffectiveCommandStatus(swCmdResponse);
@@ -147,29 +147,29 @@ StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* txn,
}
StatusWith<Shard::CommandResponse> Shard::runCommandWithFixedRetryAttempts(
- OperationContext* txn,
+ OperationContext* opCtx,
const ReadPreferenceSetting& readPref,
const std::string& dbName,
const BSONObj& cmdObj,
RetryPolicy retryPolicy) {
return runCommandWithFixedRetryAttempts(
- txn, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy);
+ opCtx, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy);
}
StatusWith<Shard::CommandResponse> Shard::runCommandWithFixedRetryAttempts(
- OperationContext* txn,
+ OperationContext* opCtx,
const ReadPreferenceSetting& readPref,
const std::string& dbName,
const BSONObj& cmdObj,
Milliseconds maxTimeMSOverride,
RetryPolicy retryPolicy) {
for (int retry = 1; retry <= kOnErrorNumRetries; ++retry) {
- auto interruptStatus = txn->checkForInterruptNoAssert();
+ auto interruptStatus = opCtx->checkForInterruptNoAssert();
if (!interruptStatus.isOK()) {
return interruptStatus;
}
- auto hostWithResponse = _runCommand(txn, readPref, dbName, maxTimeMSOverride, cmdObj);
+ auto hostWithResponse = _runCommand(opCtx, readPref, dbName, maxTimeMSOverride, cmdObj);
auto swCmdResponse = std::move(hostWithResponse.commandResponse);
auto commandStatus = _getEffectiveCommandStatus(swCmdResponse);
@@ -186,7 +186,7 @@ StatusWith<Shard::CommandResponse> Shard::runCommandWithFixedRetryAttempts(
}
BatchedCommandResponse Shard::runBatchWriteCommandOnConfig(
- OperationContext* txn, const BatchedCommandRequest& batchRequest, RetryPolicy retryPolicy) {
+ OperationContext* opCtx, const BatchedCommandRequest& batchRequest, RetryPolicy retryPolicy) {
invariant(isConfig());
const std::string dbname = batchRequest.getNS().db().toString();
@@ -195,7 +195,7 @@ BatchedCommandResponse Shard::runBatchWriteCommandOnConfig(
const BSONObj cmdObj = batchRequest.toBSON();
for (int retry = 1; retry <= kOnErrorNumRetries; ++retry) {
- auto response = _runCommand(txn,
+ auto response = _runCommand(opCtx,
ReadPreferenceSetting{ReadPreference::PrimaryOnly},
dbname,
kDefaultConfigCommandTimeout,
@@ -221,7 +221,7 @@ BatchedCommandResponse Shard::runBatchWriteCommandOnConfig(
}
StatusWith<Shard::QueryResponse> Shard::exhaustiveFindOnConfig(
- OperationContext* txn,
+ OperationContext* opCtx,
const ReadPreferenceSetting& readPref,
const repl::ReadConcernLevel& readConcernLevel,
const NamespaceString& nss,
@@ -233,7 +233,7 @@ StatusWith<Shard::QueryResponse> Shard::exhaustiveFindOnConfig(
for (int retry = 1; retry <= kOnErrorNumRetries; retry++) {
auto result =
- _exhaustiveFindOnConfig(txn, readPref, readConcernLevel, nss, query, sort, limit);
+ _exhaustiveFindOnConfig(opCtx, readPref, readConcernLevel, nss, query, sort, limit);
if (retry < kOnErrorNumRetries &&
isRetriableError(result.getStatus().code(), RetryPolicy::kIdempotent)) {