![]() |
Storage Engine API
|
The interface for creating new instances of storage engines. More...
#include <storage_engine.h>
The interface for creating new instances of storage engines.
A storage engine provides an instance of this class (along with an associated name) to the global environment, which then sets the global storage engine according to the provided configuration parameter.
Public Member Functions | |
virtual | ~Factory () |
virtual StorageEngine * | create (const StorageGlobalParams ¶ms, const StorageEngineLockFile *lockFile) const =0 |
Return a new instance of the StorageEngine. More... | |
virtual StringData | getCanonicalName () const =0 |
Returns the name of the storage engine. More... | |
virtual Status | validateCollectionStorageOptions (const BSONObj &options) const |
Validates creation options for a collection in the StorageEngine. More... | |
virtual Status | validateIndexStorageOptions (const BSONObj &options) const |
Validates creation options for an index in the StorageEngine. More... | |
virtual Status | validateMetadata (const StorageEngineMetadata &metadata, const StorageGlobalParams ¶ms) const =0 |
Validates existing metadata in the data directory against startup options. More... | |
virtual BSONObj | createMetadataOptions (const StorageGlobalParams ¶ms) const =0 |
Returns a new document suitable for storing in the data directory metadata. More... | |
virtual bool | supportsReadOnly () const |
Returns whether the engine supports read-only mode. More... | |
|
inlinevirtual |
|
pure virtual |
Return a new instance of the StorageEngine.
The lockFile parameter may be null if params.readOnly is set. Caller owns the returned pointer.
|
pure virtual |
Returns a new document suitable for storing in the data directory metadata.
This document will be used by validateMetadata() to check startup options on restart.
|
pure virtual |
Returns the name of the storage engine.
Implementations that change the value of the returned string can cause data file incompatibilities.
|
inlinevirtual |
Returns whether the engine supports read-only mode.
If read-only mode is enabled, the engine may be started on a read-only filesystem (either mounted read-only or with read-only permissions). If readOnly mode is enabled, it is undefined behavior to call methods that write data (e.g. insertRecord). This method is provided on the Factory because it must be called before the storageEngine is instantiated.
|
inlinevirtual |
Validates creation options for a collection in the StorageEngine.
Returns an error if the creation options are not valid.
Default implementation only accepts empty objects (no options).
|
inlinevirtual |
Validates creation options for an index in the StorageEngine.
Returns an error if the creation options are not valid.
Default implementation only accepts empty objects (no options).
|
pure virtual |
Validates existing metadata in the data directory against startup options.
Returns an error if the storage engine initialization should not proceed due to any inconsistencies between the current startup options and the creation options stored in the metadata.