summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/kv
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/kv')
-rw-r--r--src/mongo/db/storage/kv/kv_catalog.cpp15
-rw-r--r--src/mongo/db/storage/kv/kv_catalog.h1
-rw-r--r--src/mongo/db/storage/kv/kv_collection_catalog_entry.h2
-rw-r--r--src/mongo/db/storage/kv/kv_engine_test_harness.cpp47
-rw-r--r--src/mongo/db/storage/kv/kv_storage_engine.h7
5 files changed, 34 insertions, 38 deletions
diff --git a/src/mongo/db/storage/kv/kv_catalog.cpp b/src/mongo/db/storage/kv/kv_catalog.cpp
index 53382bd8b93..6797cdf5bff 100644
--- a/src/mongo/db/storage/kv/kv_catalog.cpp
+++ b/src/mongo/db/storage/kv/kv_catalog.cpp
@@ -32,7 +32,6 @@
#include "mongo/db/storage/kv/kv_catalog.h"
-#include <boost/scoped_ptr.hpp>
#include <stdlib.h>
#include "mongo/db/concurrency/d_concurrency.h"
@@ -54,7 +53,7 @@ namespace {
const ResourceId resourceIdCatalogMetadata(RESOURCE_METADATA, 1ULL);
}
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::string;
class KVCatalog::AddIdentChange : public RecoveryUnit::Change {
@@ -107,7 +106,7 @@ namespace {
std::string KVCatalog::_newRand() {
return str::stream()
- << boost::scoped_ptr<SecureRandom>(SecureRandom::create())->nextInt64();
+ << std::unique_ptr<SecureRandom>(SecureRandom::create())->nextInt64();
}
bool KVCatalog::_hasEntryCollidingWithRand() const {
@@ -162,7 +161,7 @@ namespace {
invariant( opCtx->lockState() == NULL ||
opCtx->lockState()->isDbLockedForMode( nsToDatabaseSubstring(ns), MODE_X ) );
- boost::scoped_ptr<Lock::ResourceLock> rLk;
+ std::unique_ptr<Lock::ResourceLock> rLk;
if (!_isRsThreadSafe && opCtx->lockState()) {
rLk.reset(new Lock::ResourceLock(opCtx->lockState(),
resourceIdCatalogMetadata,
@@ -219,7 +218,7 @@ namespace {
StringData ns,
RecordId* out ) const {
- boost::scoped_ptr<Lock::ResourceLock> rLk;
+ std::unique_ptr<Lock::ResourceLock> rLk;
if (!_isRsThreadSafe && opCtx->lockState()) {
rLk.reset(new Lock::ResourceLock(opCtx->lockState(),
resourceIdCatalogMetadata,
@@ -266,7 +265,7 @@ namespace {
StringData ns,
BSONCollectionCatalogEntry::MetaData& md ) {
- boost::scoped_ptr<Lock::ResourceLock> rLk;
+ std::unique_ptr<Lock::ResourceLock> rLk;
if (!_isRsThreadSafe && opCtx->lockState()) {
rLk.reset(new Lock::ResourceLock(opCtx->lockState(),
resourceIdCatalogMetadata,
@@ -320,7 +319,7 @@ namespace {
StringData toNS,
bool stayTemp ) {
- boost::scoped_ptr<Lock::ResourceLock> rLk;
+ std::unique_ptr<Lock::ResourceLock> rLk;
if (!_isRsThreadSafe && opCtx->lockState()) {
rLk.reset(new Lock::ResourceLock(opCtx->lockState(),
resourceIdCatalogMetadata,
@@ -371,7 +370,7 @@ namespace {
StringData ns ) {
invariant( opCtx->lockState() == NULL ||
opCtx->lockState()->isDbLockedForMode( nsToDatabaseSubstring(ns), MODE_X ) );
- boost::scoped_ptr<Lock::ResourceLock> rLk;
+ std::unique_ptr<Lock::ResourceLock> rLk;
if (!_isRsThreadSafe && opCtx->lockState()) {
rLk.reset(new Lock::ResourceLock(opCtx->lockState(),
resourceIdCatalogMetadata,
diff --git a/src/mongo/db/storage/kv/kv_catalog.h b/src/mongo/db/storage/kv/kv_catalog.h
index 359fa4cfbdb..cbdbfc515bc 100644
--- a/src/mongo/db/storage/kv/kv_catalog.h
+++ b/src/mongo/db/storage/kv/kv_catalog.h
@@ -33,7 +33,6 @@
#include <map>
#include <string>
-#include <boost/scoped_ptr.hpp>
#include <boost/thread/mutex.hpp>
#include "mongo/base/string_data.h"
diff --git a/src/mongo/db/storage/kv/kv_collection_catalog_entry.h b/src/mongo/db/storage/kv/kv_collection_catalog_entry.h
index 28392db8a61..963c9d623f9 100644
--- a/src/mongo/db/storage/kv/kv_collection_catalog_entry.h
+++ b/src/mongo/db/storage/kv/kv_collection_catalog_entry.h
@@ -89,7 +89,7 @@ namespace mongo {
KVEngine* _engine; // not owned
KVCatalog* _catalog; // not owned
std::string _ident;
- boost::scoped_ptr<RecordStore> _recordStore; // owned
+ std::unique_ptr<RecordStore> _recordStore; // owned
};
}
diff --git a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
index f2438689f8e..36aeefcf2c4 100644
--- a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
+++ b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
@@ -30,7 +30,6 @@
#include "mongo/db/storage/kv/kv_engine_test_harness.h"
-#include <boost/scoped_ptr.hpp>
#include "mongo/db/operation_context_noop.h"
#include "mongo/db/index/index_descriptor.h"
@@ -42,7 +41,7 @@
namespace mongo {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::string;
namespace {
@@ -55,12 +54,12 @@ namespace mongo {
}
TEST( KVEngineTestHarness, SimpleRS1 ) {
- scoped_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
+ unique_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
KVEngine* engine = helper->getEngine();
ASSERT( engine );
string ns = "a.b";
- scoped_ptr<RecordStore> rs;
+ unique_ptr<RecordStore> rs;
{
MyOperationContext opCtx( engine );
ASSERT_OK( engine->createRecordStore( &opCtx, ns, ns, CollectionOptions() ) );
@@ -94,7 +93,7 @@ namespace mongo {
}
TEST( KVEngineTestHarness, Restart1 ) {
- scoped_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
+ unique_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
KVEngine* engine = helper->getEngine();
ASSERT( engine );
@@ -103,7 +102,7 @@ namespace mongo {
// 'loc' holds location of "abc" and is referenced after restarting engine.
RecordId loc;
{
- scoped_ptr<RecordStore> rs;
+ unique_ptr<RecordStore> rs;
{
MyOperationContext opCtx( engine );
ASSERT_OK( engine->createRecordStore( &opCtx, ns, ns, CollectionOptions() ) );
@@ -129,7 +128,7 @@ namespace mongo {
engine = helper->restartEngine();
{
- scoped_ptr<RecordStore> rs;
+ unique_ptr<RecordStore> rs;
MyOperationContext opCtx( engine );
rs.reset( engine->getRecordStore( &opCtx, ns, ns, CollectionOptions() ) );
ASSERT_EQUALS( string("abc"), rs->dataFor( &opCtx, loc ).data() );
@@ -139,13 +138,13 @@ namespace mongo {
TEST( KVEngineTestHarness, SimpleSorted1 ) {
- scoped_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
+ unique_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
KVEngine* engine = helper->getEngine();
ASSERT( engine );
string ident = "abc";
IndexDescriptor desc( NULL, "", BSON( "key" << BSON( "a" << 1 ) ) );
- scoped_ptr<SortedDataInterface> sorted;
+ unique_ptr<SortedDataInterface> sorted;
{
MyOperationContext opCtx( engine );
ASSERT_OK( engine->createSortedDataInterface( &opCtx, ident, &desc ) );
@@ -168,11 +167,11 @@ namespace mongo {
}
TEST( KVCatalogTest, Coll1 ) {
- scoped_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
+ unique_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
KVEngine* engine = helper->getEngine();
- scoped_ptr<RecordStore> rs;
- scoped_ptr<KVCatalog> catalog;
+ unique_ptr<RecordStore> rs;
+ unique_ptr<KVCatalog> catalog;
{
MyOperationContext opCtx( engine );
WriteUnitOfWork uow( &opCtx );
@@ -212,11 +211,11 @@ namespace mongo {
TEST( KVCatalogTest, Idx1 ) {
- scoped_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
+ unique_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
KVEngine* engine = helper->getEngine();
- scoped_ptr<RecordStore> rs;
- scoped_ptr<KVCatalog> catalog;
+ unique_ptr<RecordStore> rs;
+ unique_ptr<KVCatalog> catalog;
{
MyOperationContext opCtx( engine );
WriteUnitOfWork uow( &opCtx );
@@ -284,11 +283,11 @@ namespace mongo {
}
TEST( KVCatalogTest, DirectoryPerDb1 ) {
- scoped_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
+ unique_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
KVEngine* engine = helper->getEngine();
- scoped_ptr<RecordStore> rs;
- scoped_ptr<KVCatalog> catalog;
+ unique_ptr<RecordStore> rs;
+ unique_ptr<KVCatalog> catalog;
{
MyOperationContext opCtx( engine );
WriteUnitOfWork uow( &opCtx );
@@ -326,11 +325,11 @@ namespace mongo {
}
TEST( KVCatalogTest, Split1 ) {
- scoped_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
+ unique_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
KVEngine* engine = helper->getEngine();
- scoped_ptr<RecordStore> rs;
- scoped_ptr<KVCatalog> catalog;
+ unique_ptr<RecordStore> rs;
+ unique_ptr<KVCatalog> catalog;
{
MyOperationContext opCtx( engine );
WriteUnitOfWork uow( &opCtx );
@@ -368,11 +367,11 @@ namespace mongo {
}
TEST( KVCatalogTest, DirectoryPerAndSplit1 ) {
- scoped_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
+ unique_ptr<KVHarnessHelper> helper( KVHarnessHelper::create() );
KVEngine* engine = helper->getEngine();
- scoped_ptr<RecordStore> rs;
- scoped_ptr<KVCatalog> catalog;
+ unique_ptr<RecordStore> rs;
+ unique_ptr<KVCatalog> catalog;
{
MyOperationContext opCtx( engine );
WriteUnitOfWork uow( &opCtx );
diff --git a/src/mongo/db/storage/kv/kv_storage_engine.h b/src/mongo/db/storage/kv/kv_storage_engine.h
index b6f33c2d7b5..f8106959dc3 100644
--- a/src/mongo/db/storage/kv/kv_storage_engine.h
+++ b/src/mongo/db/storage/kv/kv_storage_engine.h
@@ -33,7 +33,6 @@
#include <map>
#include <string>
-#include <boost/scoped_ptr.hpp>
#include <boost/thread/mutex.hpp>
#include "mongo/db/storage/kv/kv_catalog.h"
@@ -103,12 +102,12 @@ namespace mongo {
KVStorageEngineOptions _options;
// This must be the first member so it is destroyed last.
- boost::scoped_ptr<KVEngine> _engine;
+ std::unique_ptr<KVEngine> _engine;
const bool _supportsDocLocking;
- boost::scoped_ptr<RecordStore> _catalogRecordStore;
- boost::scoped_ptr<KVCatalog> _catalog;
+ std::unique_ptr<RecordStore> _catalogRecordStore;
+ std::unique_ptr<KVCatalog> _catalog;
typedef std::map<std::string,KVDatabaseCatalogEntry*> DBMap;
DBMap _dbs;