diff options
author | Geert Bosch <geert@mongodb.com> | 2020-04-22 01:00:21 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-06-10 16:19:05 +0000 |
commit | b63e8cc9ba5c3897c47a33a6aec9981f2e3c53de (patch) | |
tree | 0aab1c0364cc481eb1b5f0d25851e3d8214919f3 /src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp | |
parent | 07169364c2aece0fb99f4a97b796196edb033efa (diff) | |
download | mongo-b63e8cc9ba5c3897c47a33a6aec9981f2e3c53de.tar.gz |
SERVER-47873 Eliminate the Collection* saved in IndexDescriptor
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp index 4edee81f671..46043f9da4c 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp @@ -64,8 +64,8 @@ namespace { class WiredTigerFactory : public StorageEngine::Factory { public: virtual ~WiredTigerFactory() {} - virtual StorageEngine* create(const StorageGlobalParams& params, - const StorageEngineLockFile* lockFile) const { + virtual std::unique_ptr<StorageEngine> create(const StorageGlobalParams& params, + const StorageEngineLockFile* lockFile) const { if (lockFile && lockFile->createdByUncleanShutdown()) { LOGV2_WARNING(22302, "Recovering data from the last clean checkpoint."); } @@ -100,17 +100,17 @@ public: } } const bool ephemeral = false; - WiredTigerKVEngine* kv = - new WiredTigerKVEngine(getCanonicalName().toString(), - params.dbpath, - getGlobalServiceContext()->getFastClockSource(), - wiredTigerGlobalOptions.engineConfig, - cacheMB, - wiredTigerGlobalOptions.getMaxHistoryFileSizeMB(), - params.dur, - ephemeral, - params.repair, - params.readOnly); + auto kv = + std::make_unique<WiredTigerKVEngine>(getCanonicalName().toString(), + params.dbpath, + getGlobalServiceContext()->getFastClockSource(), + wiredTigerGlobalOptions.engineConfig, + cacheMB, + wiredTigerGlobalOptions.getMaxHistoryFileSizeMB(), + params.dur, + ephemeral, + params.repair, + params.readOnly); kv->setRecordStoreExtraOptions(wiredTigerGlobalOptions.collectionConfig); kv->setSortedDataInterfaceExtraOptions(wiredTigerGlobalOptions.indexConfig); @@ -121,7 +121,7 @@ public: // Intentionally leaked. MONGO_COMPILER_VARIABLE_UNUSED auto leakedSection = - new WiredTigerServerStatusSection(kv); + new WiredTigerServerStatusSection(kv.get()); // This allows unit tests to run this code without encountering memory leaks #if __has_feature(address_sanitizer) @@ -133,7 +133,7 @@ public: options.directoryPerDB = params.directoryperdb; options.directoryForIndexes = wiredTigerGlobalOptions.directoryForIndexes; options.forRepair = params.repair; - return new StorageEngineImpl(kv, options); + return std::make_unique<StorageEngineImpl>(std::move(kv), options); } virtual StringData getCanonicalName() const { |