summaryrefslogtreecommitdiff
path: root/src/mongo/db/ftdc
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/ftdc
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/ftdc')
-rw-r--r--src/mongo/db/ftdc/collector.cpp8
-rw-r--r--src/mongo/db/ftdc/collector.h2
-rw-r--r--src/mongo/db/ftdc/controller_test.cpp2
-rw-r--r--src/mongo/db/ftdc/ftdc_commands.cpp5
-rw-r--r--src/mongo/db/ftdc/ftdc_mongod.cpp4
-rw-r--r--src/mongo/db/ftdc/ftdc_system_stats_linux.cpp2
-rw-r--r--src/mongo/db/ftdc/ftdc_system_stats_windows.cpp2
7 files changed, 13 insertions, 12 deletions
diff --git a/src/mongo/db/ftdc/collector.cpp b/src/mongo/db/ftdc/collector.cpp
index 611f12dff5a..4441f2ef126 100644
--- a/src/mongo/db/ftdc/collector.cpp
+++ b/src/mongo/db/ftdc/collector.cpp
@@ -65,8 +65,8 @@ std::tuple<BSONObj, Date_t> FTDCCollectorCollection::collect(Client* client) {
// All collectors should be ok seeing the inconsistent states in the middle of replication
// batches. This is desirable because we want to be able to collect data in the middle of
// batches that are taking a long time.
- auto txn = client->makeOperationContext();
- txn->lockState()->setShouldConflictWithSecondaryBatchApplication(false);
+ auto opCtx = client->makeOperationContext();
+ opCtx->lockState()->setShouldConflictWithSecondaryBatchApplication(false);
for (auto& collector : _collectors) {
BSONObjBuilder subObjBuilder(builder.subobjStart(collector->name()));
@@ -84,8 +84,8 @@ std::tuple<BSONObj, Date_t> FTDCCollectorCollection::collect(Client* client) {
subObjBuilder.appendDate(kFTDCCollectStartField, now);
{
- ScopedTransaction st(txn.get(), MODE_IS);
- collector->collect(txn.get(), subObjBuilder);
+ ScopedTransaction st(opCtx.get(), MODE_IS);
+ collector->collect(opCtx.get(), subObjBuilder);
}
end = client->getServiceContext()->getPreciseClockSource()->now();
diff --git a/src/mongo/db/ftdc/collector.h b/src/mongo/db/ftdc/collector.h
index fd9efb199e2..90c81bda747 100644
--- a/src/mongo/db/ftdc/collector.h
+++ b/src/mongo/db/ftdc/collector.h
@@ -66,7 +66,7 @@ public:
* If a collector fails to collect data, it should update builder with the result of the
* failure.
*/
- virtual void collect(OperationContext* txn, BSONObjBuilder& builder) = 0;
+ virtual void collect(OperationContext* opCtx, BSONObjBuilder& builder) = 0;
protected:
FTDCCollectorInterface() = default;
diff --git a/src/mongo/db/ftdc/controller_test.cpp b/src/mongo/db/ftdc/controller_test.cpp
index 365f06580cd..ba545b3ad04 100644
--- a/src/mongo/db/ftdc/controller_test.cpp
+++ b/src/mongo/db/ftdc/controller_test.cpp
@@ -56,7 +56,7 @@ public:
ASSERT_TRUE(_state == State::kStarted);
}
- void collect(OperationContext* txn, BSONObjBuilder& builder) final {
+ void collect(OperationContext* opCtx, BSONObjBuilder& builder) final {
_state = State::kStarted;
++_counter;
diff --git a/src/mongo/db/ftdc/ftdc_commands.cpp b/src/mongo/db/ftdc/ftdc_commands.cpp
index e9205b1b5ab..e50f5d9cf71 100644
--- a/src/mongo/db/ftdc/ftdc_commands.cpp
+++ b/src/mongo/db/ftdc/ftdc_commands.cpp
@@ -88,7 +88,7 @@ public:
return Status::OK();
}
- bool run(OperationContext* txn,
+ bool run(OperationContext* opCtx,
const std::string& db,
BSONObj& cmdObj,
int options,
@@ -96,7 +96,8 @@ public:
BSONObjBuilder& result) override {
result.append(
- "data", FTDCController::get(txn->getServiceContext())->getMostRecentPeriodicDocument());
+ "data",
+ FTDCController::get(opCtx->getServiceContext())->getMostRecentPeriodicDocument());
return true;
}
diff --git a/src/mongo/db/ftdc/ftdc_mongod.cpp b/src/mongo/db/ftdc/ftdc_mongod.cpp
index 60c1c46c9e4..e80fd8a20b9 100644
--- a/src/mongo/db/ftdc/ftdc_mongod.cpp
+++ b/src/mongo/db/ftdc/ftdc_mongod.cpp
@@ -256,10 +256,10 @@ public:
invariant(_command);
}
- void collect(OperationContext* txn, BSONObjBuilder& builder) override {
+ void collect(OperationContext* opCtx, BSONObjBuilder& builder) override {
std::string errmsg;
- bool ret = _command->run(txn, _ns, _cmdObj, 0, errmsg, builder);
+ bool ret = _command->run(opCtx, _ns, _cmdObj, 0, errmsg, builder);
// Some commands return errmsgs when they return false (collstats)
// Some commands return bson objs when they return false (replGetStatus)
diff --git a/src/mongo/db/ftdc/ftdc_system_stats_linux.cpp b/src/mongo/db/ftdc/ftdc_system_stats_linux.cpp
index 9c93718c171..316afde8170 100644
--- a/src/mongo/db/ftdc/ftdc_system_stats_linux.cpp
+++ b/src/mongo/db/ftdc/ftdc_system_stats_linux.cpp
@@ -77,7 +77,7 @@ public:
}
}
- void collect(OperationContext* txn, BSONObjBuilder& builder) override {
+ void collect(OperationContext* opCtx, BSONObjBuilder& builder) override {
{
BSONObjBuilder subObjBuilder(builder.subobjStart("cpu"_sd));
diff --git a/src/mongo/db/ftdc/ftdc_system_stats_windows.cpp b/src/mongo/db/ftdc/ftdc_system_stats_windows.cpp
index 87f1d8503be..be6086d8743 100644
--- a/src/mongo/db/ftdc/ftdc_system_stats_windows.cpp
+++ b/src/mongo/db/ftdc/ftdc_system_stats_windows.cpp
@@ -101,7 +101,7 @@ public:
WindowsSystemMetricsCollector(std::unique_ptr<PerfCounterCollector> collector)
: _collector(std::move(collector)) {}
- void collect(OperationContext* txn, BSONObjBuilder& builder) override {
+ void collect(OperationContext* opCtx, BSONObjBuilder& builder) override {
processStatusErrors(_collector->collect(&builder), &builder);
}