summaryrefslogtreecommitdiff
path: root/src/mongo/s/sharding_initialization.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/sharding_initialization.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/sharding_initialization.cpp')
-rw-r--r--src/mongo/s/sharding_initialization.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/s/sharding_initialization.cpp b/src/mongo/s/sharding_initialization.cpp
index 1ffcbda99dd..db41e736fc6 100644
--- a/src/mongo/s/sharding_initialization.cpp
+++ b/src/mongo/s/sharding_initialization.cpp
@@ -145,17 +145,17 @@ std::unique_ptr<TaskExecutorPool> makeTaskExecutorPool(
const StringData kDistLockProcessIdForConfigServer("ConfigServer");
-std::string generateDistLockProcessId(OperationContext* txn) {
+std::string generateDistLockProcessId(OperationContext* opCtx) {
std::unique_ptr<SecureRandom> rng(SecureRandom::create());
return str::stream()
<< HostAndPort(getHostName(), serverGlobalParams.port).toString() << ':'
<< durationCount<Seconds>(
- txn->getServiceContext()->getPreciseClockSource()->now().toDurationSinceEpoch())
+ opCtx->getServiceContext()->getPreciseClockSource()->now().toDurationSinceEpoch())
<< ':' << rng->nextInt64();
}
-Status initializeGlobalShardingState(OperationContext* txn,
+Status initializeGlobalShardingState(OperationContext* opCtx,
const ConnectionString& configCS,
StringData distLockProcessId,
std::unique_ptr<ShardFactory> shardFactory,
@@ -189,7 +189,7 @@ Status initializeGlobalShardingState(OperationContext* txn,
auto shardRegistry(stdx::make_unique<ShardRegistry>(std::move(shardFactory), configCS));
auto catalogClient =
- makeCatalogClient(txn->getServiceContext(), shardRegistry.get(), distLockProcessId);
+ makeCatalogClient(opCtx->getServiceContext(), shardRegistry.get(), distLockProcessId);
auto rawCatalogClient = catalogClient.get();
@@ -227,20 +227,20 @@ Status initializeGlobalShardingState(OperationContext* txn,
return Status::OK();
}
-Status reloadShardRegistryUntilSuccess(OperationContext* txn) {
+Status reloadShardRegistryUntilSuccess(OperationContext* opCtx) {
if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) {
return Status::OK();
}
while (!globalInShutdownDeprecated()) {
- auto stopStatus = txn->checkForInterruptNoAssert();
+ auto stopStatus = opCtx->checkForInterruptNoAssert();
if (!stopStatus.isOK()) {
return stopStatus;
}
try {
- uassertStatusOK(ClusterIdentityLoader::get(txn)->loadClusterId(
- txn, repl::ReadConcernLevel::kMajorityReadConcern));
+ uassertStatusOK(ClusterIdentityLoader::get(opCtx)->loadClusterId(
+ opCtx, repl::ReadConcernLevel::kMajorityReadConcern));
if (grid.shardRegistry()->isUp()) {
return Status::OK();
}