![]() |
Storage Engine API
|
#include <kv_engine.h>
Public Member Functions | |
virtual RecoveryUnit * | newRecoveryUnit ()=0 |
virtual std::unique_ptr< RecordStore > | getRecordStore (OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options)=0 |
Having multiple out for the same ns is a rules violation; Calling on a non-created ident is invalid and may crash. More... | |
virtual std::unique_ptr< RecordStore > | getGroupedRecordStore (OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options, KVPrefix prefix) |
Get a RecordStore that may share an underlying table with other RecordStores. More... | |
virtual SortedDataInterface * | getSortedDataInterface (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc)=0 |
virtual SortedDataInterface * | getGroupedSortedDataInterface (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc, KVPrefix prefix) |
Get a SortedDataInterface that may share an underlying table with other SortedDataInterface. More... | |
virtual Status | createRecordStore (OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options)=0 |
The create and drop methods on KVEngine are not transactional. More... | |
virtual Status | createGroupedRecordStore (OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options, KVPrefix prefix) |
Create a RecordStore that MongoDB considers eligible to share space in an underlying table with other RecordStores. More... | |
virtual Status | createSortedDataInterface (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc)=0 |
virtual Status | createGroupedSortedDataInterface (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc, KVPrefix prefix) |
Create a SortedDataInterface that MongoDB considers eligible to share space in an underlying table with other SortedDataInterfaces. More... | |
virtual int64_t | getIdentSize (OperationContext *opCtx, StringData ident)=0 |
virtual Status | repairIdent (OperationContext *opCtx, StringData ident)=0 |
virtual Status | dropIdent (OperationContext *opCtx, StringData ident)=0 |
virtual void | alterIdentMetadata (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc) |
virtual int | flushAllFiles (OperationContext *opCtx, bool sync) |
virtual Status | beginBackup (OperationContext *opCtx) |
See StorageEngine::beginBackup for details. More... | |
virtual void | endBackup (OperationContext *opCtx) |
See StorageEngine::endBackup for details. More... | |
virtual bool | isDurable () const =0 |
virtual bool | isEphemeral () const =0 |
Returns true if the KVEngine is ephemeral – that is, it is NOT persistent and all data is lost after shutdown. More... | |
virtual bool | supportsDocLocking () const =0 |
This must not change over the lifetime of the engine. More... | |
virtual bool | supportsDBLocking () const |
This must not change over the lifetime of the engine. More... | |
virtual bool | supportsCappedCollections () const |
This must not change over the lifetime of the engine. More... | |
virtual bool | supportsDirectoryPerDB () const =0 |
Returns true if storage engine supports –directoryperdb. More... | |
virtual Status | okToRename (OperationContext *opCtx, StringData fromNS, StringData toNS, StringData ident, const RecordStore *originalRecordStore) const |
virtual bool | hasIdent (OperationContext *opCtx, StringData ident) const =0 |
virtual std::vector< std::string > | getAllIdents (OperationContext *opCtx) const =0 |
virtual void | cleanShutdown ()=0 |
This method will be called before there is a clean shutdown. More... | |
virtual SnapshotManager * | getSnapshotManager () const |
Return the SnapshotManager for this KVEngine or NULL if not supported. More... | |
virtual void | setJournalListener (JournalListener *jl)=0 |
Sets a new JournalListener, which is used to alert the rest of the system about journaled write progress. More... | |
virtual void | setStableTimestamp (Timestamp stableTimestamp) |
See StorageEngine::setStableTimestamp More... | |
virtual void | setInitialDataTimestamp (Timestamp initialDataTimestamp) |
See StorageEngine::setInitialDataTimestamp More... | |
virtual void | setOldestTimestampFromStable () |
See StorageEngine::setOldestTimestampFromStable More... | |
virtual void | setOldestTimestamp (Timestamp newOldestTimestamp) |
See StorageEngine::setOldestTimestamp More... | |
virtual bool | isCacheUnderPressure (OperationContext *opCtx) const |
See StorageEngine::isCacheUnderPressure() More... | |
virtual void | setCachePressureForTest (int pressure) |
See 'StorageEngine::setCachePressureForTest()'. More... | |
virtual bool | supportsRecoverToStableTimestamp () const |
See StorageEngine::supportsRecoverToStableTimestamp More... | |
virtual StatusWith< Timestamp > | recoverToStableTimestamp (OperationContext *opCtx) |
See StorageEngine::recoverToStableTimestamp More... | |
virtual boost::optional< Timestamp > | getRecoveryTimestamp () const |
See StorageEngine::getRecoveryTimestamp More... | |
virtual boost::optional< Timestamp > | getLastStableCheckpointTimestamp () const |
See StorageEngine::getLastStableCheckpointTimestamp More... | |
virtual Timestamp | getAllCommittedTimestamp () const =0 |
See StorageEngine::getAllCommittedTimestamp More... | |
virtual bool | supportsReadConcernSnapshot () const |
See StorageEngine::supportsReadConcernSnapshot More... | |
virtual void | replicationBatchIsComplete () const |
See StorageEngine::replicationBatchIsComplete() More... | |
virtual | ~KVEngine () |
The destructor will never be called from mongod, but may be called from tests. More... | |
|
inlinevirtual |
The destructor will never be called from mongod, but may be called from tests.
Engines may assume that this will only be called in the case of clean shutdown, even if cleanShutdown() hasn't been called.
|
inlinevirtual |
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
See StorageEngine::beginBackup for details.
Reimplemented in mongo::WiredTigerKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
pure virtual |
This method will be called before there is a clean shutdown.
Storage engines should override this method if they have clean-up to do that is different from unclean shutdown. MongoDB will not call into the storage subsystem after calling this function.
There is intentionally no uncleanShutdown().
Implemented in mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
Create a RecordStore that MongoDB considers eligible to share space in an underlying table with other RecordStores.
'prefix' is guaranteed to be 'KVPrefix::kNotPrefixed' when 'groupCollections' is not enabled.
prefix | signals whether the RecordStore may be shared by an underlying table. A prefix of KVPrefix::kNotPrefixed must remain isolated in its own table. Otherwise the storage engine implementation ultimately chooses which RecordStores share a table. Sharing RecordStores belonging to different databases within the same table is forbidden. |
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
Create a SortedDataInterface that MongoDB considers eligible to share space in an underlying table with other SortedDataInterfaces.
'prefix' is guaranteed to be 'KVPrefix::kNotPrefixed' when 'groupCollections' is not enabled.
prefix | signals whether the SortedDataInterface (index) may be shared by an underlying table. A prefix of KVPrefix::kNotPrefixed must remain isolated in its own table. Otherwise the storage engine implementation ultimately chooses which indexes share a table. Sharing indexes belonging to different databases is forbidden. |
Reimplemented in mongo::WiredTigerKVEngine.
|
pure virtual |
The create and drop methods on KVEngine are not transactional.
Transactional semantics are provided by the KVStorageEngine code that calls these. For example, drop will be called if a create is rolled back. A higher-level drop operation will only propagate to a drop call on the KVEngine once the WUOW commits. Therefore drops will never be rolled back and it is safe to immediately reclaim storage.
Implemented in mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
pure virtual |
Implemented in mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
pure virtual |
Implemented in mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
See StorageEngine::endBackup for details.
Reimplemented in mongo::WiredTigerKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
Reimplemented in mongo::WiredTigerKVEngine, and mongo::MobileKVEngine.
|
pure virtual |
|
pure virtual |
Implemented in mongo::WiredTigerKVEngine, mongo::MobileKVEngine, mongo::DevNullKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
Get a RecordStore that may share an underlying table with other RecordStores.
'prefix' is guaranteed to be 'KVPrefix::kNotPrefixed' when 'groupCollections' is not enabled.
prefix | dictates the value keys for the RecordStore should be prefixed with to distinguish between RecordStores sharing an underlying table. A value of KVPrefix::kNotPrefixed guarantees the index is the sole resident of the table. |
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
Get a SortedDataInterface that may share an underlying table with other SortedDataInterface.
'prefix' is guaranteed to be 'KVPrefix::kNotPrefixed' when 'groupCollections' is not enabled.
prefix | dictates the value keys for the index should be prefixed with to distinguish between indexes sharing an underlying table. A value of KVPrefix::kNotPrefixed guarantees the index is the sole resident of the table. |
Reimplemented in mongo::WiredTigerKVEngine.
|
pure virtual |
Implemented in mongo::WiredTigerKVEngine, mongo::MobileKVEngine, mongo::DevNullKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
See StorageEngine::getLastStableCheckpointTimestamp
Reimplemented in mongo::WiredTigerKVEngine.
|
pure virtual |
Having multiple out for the same ns is a rules violation; Calling on a non-created ident is invalid and may crash.
Implemented in mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
See StorageEngine::getRecoveryTimestamp
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
Return the SnapshotManager for this KVEngine or NULL if not supported.
Pointer remains owned by the StorageEngine, not the caller.
Reimplemented in mongo::WiredTigerKVEngine.
|
pure virtual |
Implemented in mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
pure virtual |
Implemented in mongo::WiredTigerKVEngine, mongo::MobileKVEngine, mongo::DevNullKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
See StorageEngine::isCacheUnderPressure()
Reimplemented in mongo::WiredTigerKVEngine, and mongo::DevNullKVEngine.
|
pure virtual |
Implemented in mongo::MobileKVEngine, mongo::DevNullKVEngine, mongo::WiredTigerKVEngine, and mongo::EphemeralForTestEngine.
|
pure virtual |
Returns true if the KVEngine is ephemeral – that is, it is NOT persistent and all data is lost after shutdown.
Otherwise, returns false.
Implemented in mongo::MobileKVEngine, mongo::DevNullKVEngine, mongo::WiredTigerKVEngine, and mongo::EphemeralForTestEngine.
|
pure virtual |
Implemented in mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
See StorageEngine::recoverToStableTimestamp
Reimplemented in mongo::WiredTigerKVEngine.
|
pure virtual |
Implemented in mongo::WiredTigerKVEngine, mongo::MobileKVEngine, mongo::DevNullKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
See StorageEngine::replicationBatchIsComplete()
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
See 'StorageEngine::setCachePressureForTest()'.
Reimplemented in mongo::DevNullKVEngine.
|
inlinevirtual |
See StorageEngine::setInitialDataTimestamp
Reimplemented in mongo::WiredTigerKVEngine.
|
pure virtual |
Sets a new JournalListener, which is used to alert the rest of the system about journaled write progress.
Implemented in mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
See StorageEngine::setOldestTimestamp
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
See StorageEngine::setOldestTimestampFromStable
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
See StorageEngine::setStableTimestamp
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
This must not change over the lifetime of the engine.
Reimplemented in mongo::MobileKVEngine.
|
inlinevirtual |
This must not change over the lifetime of the engine.
Reimplemented in mongo::MobileKVEngine.
|
pure virtual |
Returns true if storage engine supports –directoryperdb.
See: http://docs.mongodb.org/manual/reference/program/mongod/#cmdoption–directoryperdb
Implemented in mongo::MobileKVEngine, mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, and mongo::EphemeralForTestEngine.
|
pure virtual |
This must not change over the lifetime of the engine.
Implemented in mongo::WiredTigerKVEngine, mongo::DevNullKVEngine, mongo::MobileKVEngine, and mongo::EphemeralForTestEngine.
|
inlinevirtual |
See StorageEngine::supportsReadConcernSnapshot
Reimplemented in mongo::WiredTigerKVEngine.
|
inlinevirtual |
See StorageEngine::supportsRecoverToStableTimestamp
Reimplemented in mongo::WiredTigerKVEngine.