summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/service_context.h')
-rw-r--r--src/mongo/db/service_context.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h
index 7ef549cac20..305a85c226f 100644
--- a/src/mongo/db/service_context.h
+++ b/src/mongo/db/service_context.h
@@ -267,9 +267,23 @@ public:
virtual void shutdownGlobalStorageEngineCleanly() = 0;
/**
+ * Sets the storage engine for this instance. May be called up to once per instance.
+ */
+ void setStorageEngine(std::unique_ptr<StorageEngine> engine);
+
+ /**
+ * Return the storage engine instance we're using.
+ */
+ StorageEngine* getStorageEngine() {
+ return _storageEngine.get();
+ }
+
+ /**
* Return the storage engine instance we're using.
*/
- virtual StorageEngine* getGlobalStorageEngine() = 0;
+ StorageEngine* getGlobalStorageEngine() {
+ return getStorageEngine();
+ }
//
// Global operation management. This may not belong here and there may be too many methods
@@ -461,6 +475,11 @@ private:
virtual std::unique_ptr<OperationContext> _newOpCtx(Client* client, unsigned opId) = 0;
/**
+ * The storage engine, if any.
+ */
+ std::unique_ptr<StorageEngine> _storageEngine;
+
+ /**
* The periodic runner.
*/
std::unique_ptr<PeriodicRunner> _runner;