diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2016-05-24 16:34:45 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2016-06-03 12:48:38 -0400 |
commit | 910e782aa5d8329c5e8b2531cf0116052e8a187e (patch) | |
tree | 8c7b17d5808ffaf4b8b9c4ff6a973e34d4b851eb /src/mongo/db/storage/record_store_test_repairiter.cpp | |
parent | 0b5cbbadf49da830f20fba6e779b7278f211e394 (diff) | |
download | mongo-910e782aa5d8329c5e8b2531cf0116052e8a187e.tar.gz |
SERVER-23905 Unify lifetime management for LockState on OperationContexts into OperationContext.
This change also moves responsibility for registering OperationContexts to Clients into
ServiceContext::makeOperationContext.
Diffstat (limited to 'src/mongo/db/storage/record_store_test_repairiter.cpp')
-rw-r--r-- | src/mongo/db/storage/record_store_test_repairiter.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/db/storage/record_store_test_repairiter.cpp b/src/mongo/db/storage/record_store_test_repairiter.cpp index 7c158d4b6e7..eca6c3fdc1d 100644 --- a/src/mongo/db/storage/record_store_test_repairiter.cpp +++ b/src/mongo/db/storage/record_store_test_repairiter.cpp @@ -51,12 +51,12 @@ TEST(RecordStoreTestHarness, GetIteratorForRepairEmpty) { unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore()); { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(0, rs->numRecords(opCtx.get())); } { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); auto cursor = rs->getCursorForRepair(opCtx.get()); // returns NULL if getCursorForRepair is not supported if (!cursor) { @@ -73,14 +73,14 @@ TEST(RecordStoreTestHarness, GetIteratorForRepairNonEmpty) { unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore()); { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(0, rs->numRecords(opCtx.get())); } const int nToInsert = 10; RecordId locs[nToInsert]; for (int i = 0; i < nToInsert; i++) { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { stringstream ss; ss << "record " << i; @@ -96,13 +96,13 @@ TEST(RecordStoreTestHarness, GetIteratorForRepairNonEmpty) { } { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(nToInsert, rs->numRecords(opCtx.get())); } set<RecordId> remain(locs, locs + nToInsert); { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); auto cursor = rs->getCursorForRepair(opCtx.get()); // returns NULL if getCursorForRepair is not supported if (!cursor) { @@ -126,14 +126,14 @@ TEST(RecordStoreTestHarness, GetIteratorForRepairInvalidateSingleton) { unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore()); { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQ(0, rs->numRecords(opCtx.get())); } // Insert one record. RecordId idToInvalidate; { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); WriteUnitOfWork uow(opCtx.get()); StatusWith<RecordId> res = rs->insertRecord(opCtx.get(), "some data", 10, false); ASSERT_OK(res.getStatus()); @@ -143,12 +143,12 @@ TEST(RecordStoreTestHarness, GetIteratorForRepairInvalidateSingleton) { // Double-check that the record store has one record in it now. { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQ(1, rs->numRecords(opCtx.get())); } { - unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); auto cursor = rs->getCursorForRepair(opCtx.get()); // returns NULL if getCursorForRepair is not supported if (!cursor) { |