diff options
Diffstat (limited to 'src/mongo/db/storage/mobile')
7 files changed, 42 insertions, 42 deletions
diff --git a/src/mongo/db/storage/mobile/mobile_index.cpp b/src/mongo/db/storage/mobile/mobile_index.cpp index a1c54273ce0..263efc98bba 100644 --- a/src/mongo/db/storage/mobile/mobile_index.cpp +++ b/src/mongo/db/storage/mobile/mobile_index.cpp @@ -386,14 +386,14 @@ public: _startPosition(index.getKeyStringVersion()) { MobileSession* session = MobileRecoveryUnit::get(opCtx)->getSession(opCtx); - _stmt = stdx::make_unique<SqliteStatement>(*session, - "SELECT key, value FROM \"", - _index.getIdent(), - "\" WHERE key ", - (_isForward ? ">=" : "<="), - " ? ORDER BY key ", - (_isForward ? "ASC" : "DESC"), - ";"); + _stmt = std::make_unique<SqliteStatement>(*session, + "SELECT key, value FROM \"", + _index.getIdent(), + "\" WHERE key ", + (_isForward ? ">=" : "<="), + " ? ORDER BY key ", + (_isForward ? "ASC" : "DESC"), + ";"); } virtual ~CursorBase() {} @@ -420,7 +420,7 @@ public: // key if inclusive and before if exclusive. const auto discriminator = _isForward == inclusive ? KeyString::kExclusiveAfter : KeyString::kExclusiveBefore; - _endPosition = stdx::make_unique<KeyString>(_index.getKeyStringVersion()); + _endPosition = std::make_unique<KeyString>(_index.getKeyStringVersion()); _endPosition->resetToKey(stripFieldNames(key), _index.getOrdering(), discriminator); } @@ -660,7 +660,7 @@ SortedDataBuilderInterface* MobileIndexStandard::getBulkBuilder(OperationContext std::unique_ptr<SortedDataInterface::Cursor> MobileIndexStandard::newCursor(OperationContext* opCtx, bool isForward) const { - return stdx::make_unique<CursorStandard>(*this, opCtx, isForward); + return std::make_unique<CursorStandard>(*this, opCtx, isForward); } StatusWith<SpecialFormatInserted> MobileIndexStandard::_insert(OperationContext* opCtx, @@ -699,7 +699,7 @@ SortedDataBuilderInterface* MobileIndexUnique::getBulkBuilder(OperationContext* std::unique_ptr<SortedDataInterface::Cursor> MobileIndexUnique::newCursor(OperationContext* opCtx, bool isForward) const { - return stdx::make_unique<CursorUnique>(*this, opCtx, isForward); + return std::make_unique<CursorUnique>(*this, opCtx, isForward); } StatusWith<SpecialFormatInserted> MobileIndexUnique::_insert(OperationContext* opCtx, diff --git a/src/mongo/db/storage/mobile/mobile_index_test.cpp b/src/mongo/db/storage/mobile/mobile_index_test.cpp index 8013d939505..f11052b3eb1 100644 --- a/src/mongo/db/storage/mobile/mobile_index_test.cpp +++ b/src/mongo/db/storage/mobile/mobile_index_test.cpp @@ -29,6 +29,7 @@ #include <boost/filesystem.hpp> #include <boost/system/error_code.hpp> +#include <memory> #include "mongo/base/init.h" #include "mongo/db/operation_context_noop.h" @@ -37,7 +38,6 @@ #include "mongo/db/storage/mobile/mobile_session_pool.h" #include "mongo/db/storage/sorted_data_interface_test_harness.h" #include "mongo/platform/basic.h" -#include "mongo/stdx/memory.h" #include "mongo/unittest/temp_dir.h" #include "mongo/unittest/unittest.h" @@ -61,14 +61,14 @@ public: fassert(37052, status); if (isUnique) { - return stdx::make_unique<MobileIndexUnique>( + return std::make_unique<MobileIndexUnique>( _ordering, ident, "test.mobile", "indexName"); } - return stdx::make_unique<MobileIndexStandard>(_ordering, ident, "test.mobile", "indexName"); + return std::make_unique<MobileIndexStandard>(_ordering, ident, "test.mobile", "indexName"); } std::unique_ptr<RecoveryUnit> newRecoveryUnit() { - return stdx::make_unique<MobileRecoveryUnit>(_sessionPool.get()); + return std::make_unique<MobileRecoveryUnit>(_sessionPool.get()); } private: @@ -79,7 +79,7 @@ private: }; std::unique_ptr<HarnessHelper> makeHarnessHelper() { - return stdx::make_unique<MobileIndexTestHarnessHelper>(); + return std::make_unique<MobileIndexTestHarnessHelper>(); } MONGO_INITIALIZER(RegisterHarnessFactory)(InitializerContext* const) { diff --git a/src/mongo/db/storage/mobile/mobile_kv_engine.cpp b/src/mongo/db/storage/mobile/mobile_kv_engine.cpp index 4bf076e5b99..3426827ee1e 100644 --- a/src/mongo/db/storage/mobile/mobile_kv_engine.cpp +++ b/src/mongo/db/storage/mobile/mobile_kv_engine.cpp @@ -48,7 +48,6 @@ #include "mongo/db/storage/mobile/mobile_session.h" #include "mongo/db/storage/mobile/mobile_sqlite_statement.h" #include "mongo/db/storage/mobile/mobile_util.h" -#include "mongo/stdx/memory.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" @@ -219,7 +218,7 @@ std::unique_ptr<RecordStore> MobileKVEngine::getRecordStore(OperationContext* op StringData ns, StringData ident, const CollectionOptions& options) { - return stdx::make_unique<MobileRecordStore>(opCtx, ns, _path, ident.toString(), options); + return std::make_unique<MobileRecordStore>(opCtx, ns, _path, ident.toString(), options); } std::unique_ptr<RecordStore> MobileKVEngine::makeTemporaryRecordStore(OperationContext* opCtx, diff --git a/src/mongo/db/storage/mobile/mobile_kv_engine_test.cpp b/src/mongo/db/storage/mobile/mobile_kv_engine_test.cpp index 3cde73486e7..dfa93f18c19 100644 --- a/src/mongo/db/storage/mobile/mobile_kv_engine_test.cpp +++ b/src/mongo/db/storage/mobile/mobile_kv_engine_test.cpp @@ -29,10 +29,11 @@ #include "mongo/base/init.h" +#include <memory> + #include "mongo/db/storage/kv/kv_engine_test_harness.h" #include "mongo/db/storage/mobile/mobile_kv_engine.h" #include "mongo/db/storage/mobile/mobile_options_gen.h" -#include "mongo/stdx/memory.h" #include "mongo/unittest/temp_dir.h" #include "mongo/util/options_parser/options_parser.h" #include "mongo/util/options_parser/startup_options.h" @@ -56,7 +57,7 @@ public: storeMobileStorageOptionDefinitions(optionenvironment::startupOptionsParsed).ignore(); embedded::mobileGlobalOptions.disableVacuumJob = true; - _engine = stdx::make_unique<MobileKVEngine>( + _engine = std::make_unique<MobileKVEngine>( _dbPath.path(), embedded::mobileGlobalOptions, nullptr); } @@ -77,7 +78,7 @@ private: }; std::unique_ptr<KVHarnessHelper> makeHelper() { - return stdx::make_unique<MobileKVHarnessHelper>(); + return std::make_unique<MobileKVHarnessHelper>(); } MONGO_INITIALIZER(RegisterKVHarnessFactory)(InitializerContext*) { diff --git a/src/mongo/db/storage/mobile/mobile_record_store.cpp b/src/mongo/db/storage/mobile/mobile_record_store.cpp index a28d26dcb3d..ba81032d609 100644 --- a/src/mongo/db/storage/mobile/mobile_record_store.cpp +++ b/src/mongo/db/storage/mobile/mobile_record_store.cpp @@ -33,6 +33,7 @@ #include "mongo/db/storage/mobile/mobile_record_store.h" +#include <memory> #include <sqlite3.h> #include "mongo/base/static_assert.h" @@ -46,7 +47,6 @@ #include "mongo/db/storage/mobile/mobile_util.h" #include "mongo/db/storage/oplog_hack.h" #include "mongo/db/storage/recovery_unit.h" -#include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" #include "mongo/util/str.h" @@ -63,16 +63,16 @@ public: : _opCtx(opCtx), _forward(forward) { MobileSession* session = MobileRecoveryUnit::get(_opCtx)->getSession(_opCtx); - _stmt = stdx::make_unique<SqliteStatement>(*session, - "SELECT rec_id, data from \"", - ident, - "\" ", - "WHERE rec_id ", - (forward ? ">" : "<"), - " ? ", - "ORDER BY rec_id ", - (forward ? "ASC" : "DESC"), - ";"); + _stmt = std::make_unique<SqliteStatement>(*session, + "SELECT rec_id, data from \"", + ident, + "\" ", + "WHERE rec_id ", + (forward ? ">" : "<"), + " ? ", + "ORDER BY rec_id ", + (forward ? "ASC" : "DESC"), + ";"); _startIdNum = (forward ? RecordId::min().repr() : RecordId::max().repr()); _savedId = RecordId(_startIdNum); @@ -387,7 +387,7 @@ StatusWith<RecordData> MobileRecordStore::updateWithDamages( std::unique_ptr<SeekableRecordCursor> MobileRecordStore::getCursor(OperationContext* opCtx, bool forward) const { - return stdx::make_unique<Cursor>(opCtx, *this, _path, _ident, forward); + return std::make_unique<Cursor>(opCtx, *this, _path, _ident, forward); } /** diff --git a/src/mongo/db/storage/mobile/mobile_record_store_test.cpp b/src/mongo/db/storage/mobile/mobile_record_store_test.cpp index 8fb268d64f4..c0927a227f8 100644 --- a/src/mongo/db/storage/mobile/mobile_record_store_test.cpp +++ b/src/mongo/db/storage/mobile/mobile_record_store_test.cpp @@ -31,6 +31,7 @@ #include <boost/filesystem.hpp> #include <boost/system/error_code.hpp> +#include <memory> #include "mongo/base/init.h" #include "mongo/db/catalog/collection_options.h" @@ -43,7 +44,6 @@ #include "mongo/db/storage/mobile/mobile_sqlite_statement.h" #include "mongo/db/storage/mobile/mobile_util.h" #include "mongo/db/storage/record_store_test_harness.h" -#include "mongo/stdx/memory.h" #include "mongo/unittest/temp_dir.h" #include "mongo/unittest/unittest.h" #include "mongo/util/options_parser/options_parser.h" @@ -112,7 +112,7 @@ public: std::unique_ptr<RecordStore> newNonCappedRecordStore(const std::string& ns) override { ServiceContext::UniqueOperationContext opCtx(this->newOperationContext()); MobileRecordStore::create(opCtx.get(), ns); - return stdx::make_unique<MobileRecordStore>( + return std::make_unique<MobileRecordStore>( opCtx.get(), ns, _fullPath, ns, CollectionOptions()); } @@ -131,11 +131,11 @@ public: options.capped = true; options.cappedSize = cappedMaxSize; options.cappedMaxDocs = cappedMaxDocs; - return stdx::make_unique<MobileRecordStore>(opCtx.get(), ns, _fullPath, ns, options); + return std::make_unique<MobileRecordStore>(opCtx.get(), ns, _fullPath, ns, options); } std::unique_ptr<RecoveryUnit> newRecoveryUnit() final { - return stdx::make_unique<MobileRecoveryUnit>(_sessionPool.get()); + return std::make_unique<MobileRecoveryUnit>(_sessionPool.get()); } bool supportsDocLocking() final { @@ -149,7 +149,7 @@ private: }; std::unique_ptr<HarnessHelper> makeHarnessHelper() { - return stdx::make_unique<MobileHarnessHelper>(); + return std::make_unique<MobileHarnessHelper>(); } MONGO_INITIALIZER(RegisterHarnessFactory)(InitializerContext* const) { diff --git a/src/mongo/db/storage/mobile/mobile_session_pool.cpp b/src/mongo/db/storage/mobile/mobile_session_pool.cpp index 1e73885d8b0..179a30cbe5e 100644 --- a/src/mongo/db/storage/mobile/mobile_session_pool.cpp +++ b/src/mongo/db/storage/mobile/mobile_session_pool.cpp @@ -114,7 +114,7 @@ std::unique_ptr<MobileSession> MobileSessionPool::getSession(OperationContext* o // Checks if there is an open session available. if (!_sessions.empty()) { sqlite3* session = _popSession_inlock(); - return stdx::make_unique<MobileSession>(session, this); + return std::make_unique<MobileSession>(session, this); } // Checks if a new session can be opened. @@ -124,7 +124,7 @@ std::unique_ptr<MobileSession> MobileSessionPool::getSession(OperationContext* o embedded::checkStatus(status, SQLITE_OK, "sqlite3_open"); embedded::configureSession(session, _options); _curPoolSize++; - return stdx::make_unique<MobileSession>(session, this); + return std::make_unique<MobileSession>(session, this); } // There are no open sessions available and the maxPoolSize has been reached. @@ -133,7 +133,7 @@ std::unique_ptr<MobileSession> MobileSessionPool::getSession(OperationContext* o _releasedSessionNotifier, lk, [&] { return !_sessions.empty(); }); sqlite3* session = _popSession_inlock(); - return stdx::make_unique<MobileSession>(session, this); + return std::make_unique<MobileSession>(session, this); } void MobileSessionPool::releaseSession(MobileSession* session) { @@ -170,7 +170,7 @@ void MobileSessionPool::shutDown() { int status = sqlite3_open(_path.c_str(), &session); embedded::checkStatus(status, SQLITE_OK, "sqlite3_open"); - std::unique_ptr<MobileSession> mobSession = stdx::make_unique<MobileSession>(session, this); + std::unique_ptr<MobileSession> mobSession = std::make_unique<MobileSession>(session, this); LOG(MOBILE_LOG_LEVEL_LOW) << "MobileSE: Executing queued drops at shutdown"; failedDropsQueue.execAndDequeueAllOps(mobSession.get()); sqlite3_close(session); |