Storage Engine API
mongo::DevNullKVEngine Class Reference

The devnull storage engine is intended for unit and performance testing. More...

#include <devnull_kv_engine.h>

Inheritance diagram for mongo::DevNullKVEngine:
mongo::KVEngine

Detailed Description

The devnull storage engine is intended for unit and performance testing.

Public Member Functions

virtual ~DevNullKVEngine ()
 
virtual RecoveryUnitnewRecoveryUnit ()
 
virtual Status createRecordStore (OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options)
 The create and drop methods on KVEngine are not transactional. More...
 
virtual std::unique_ptr< RecordStoregetRecordStore (OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options)
 Having multiple out for the same ns is a rules violation; Calling on a non-created ident is invalid and may crash. More...
 
virtual Status createSortedDataInterface (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc)
 
virtual SortedDataInterfacegetSortedDataInterface (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc)
 
virtual Status dropIdent (OperationContext *opCtx, StringData ident)
 
virtual bool supportsDocLocking () const
 This must not change over the lifetime of the engine. More...
 
virtual bool supportsDirectoryPerDB () const
 Returns true if storage engine supports –directoryperdb. More...
 
virtual bool isDurable () const
 devnull does no journaling, so don't report the engine as durable. More...
 
virtual bool isEphemeral () const
 Returns true if the KVEngine is ephemeral – that is, it is NOT persistent and all data is lost after shutdown. More...
 
virtual bool isCacheUnderPressure (OperationContext *opCtx) const override
 See StorageEngine::isCacheUnderPressure() More...
 
virtual void setCachePressureForTest (int pressure) override
 See 'StorageEngine::setCachePressureForTest()'. More...
 
virtual int64_t getIdentSize (OperationContext *opCtx, StringData ident)
 
virtual Status repairIdent (OperationContext *opCtx, StringData ident)
 
virtual bool hasIdent (OperationContext *opCtx, StringData ident) const
 
std::vector< std::string > getAllIdents (OperationContext *opCtx) const
 
virtual void cleanShutdown ()
 This method will be called before there is a clean shutdown. More...
 
void setJournalListener (JournalListener *jl) final
 Sets a new JournalListener, which is used to alert the rest of the system about journaled write progress. More...
 
virtual Timestamp getAllCommittedTimestamp () const override
 See StorageEngine::getAllCommittedTimestamp More...
 
- Public Member Functions inherited from mongo::KVEngine
virtual std::unique_ptr< RecordStoregetGroupedRecordStore (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 SortedDataInterfacegetGroupedSortedDataInterface (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc, KVPrefix prefix)
 Get a SortedDataInterface that may share an underlying table with other SortedDataInterface. 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 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 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 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 Status okToRename (OperationContext *opCtx, StringData fromNS, StringData toNS, StringData ident, const RecordStore *originalRecordStore) const
 
virtual SnapshotManagergetSnapshotManager () const
 Return the SnapshotManager for this KVEngine or NULL if not supported. 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 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 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...
 

Private Attributes

std::shared_ptr< void_catalogInfo
 
int _cachePressureForTest
 

Constructor & Destructor Documentation

◆ ~DevNullKVEngine()

virtual mongo::DevNullKVEngine::~DevNullKVEngine ( )
inlinevirtual

Member Function Documentation

◆ cleanShutdown()

virtual void mongo::DevNullKVEngine::cleanShutdown ( )
inlinevirtual

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().

Implements mongo::KVEngine.

◆ createRecordStore()

virtual Status mongo::DevNullKVEngine::createRecordStore ( OperationContext *  opCtx,
StringData  ns,
StringData  ident,
const CollectionOptions options 
)
inlinevirtual

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.

Implements mongo::KVEngine.

◆ createSortedDataInterface()

virtual Status mongo::DevNullKVEngine::createSortedDataInterface ( OperationContext *  opCtx,
StringData  ident,
const IndexDescriptor *  desc 
)
inlinevirtual

Implements mongo::KVEngine.

◆ dropIdent()

virtual Status mongo::DevNullKVEngine::dropIdent ( OperationContext *  opCtx,
StringData  ident 
)
inlinevirtual

Implements mongo::KVEngine.

◆ getAllCommittedTimestamp()

virtual Timestamp mongo::DevNullKVEngine::getAllCommittedTimestamp ( ) const
inlineoverridevirtual

◆ getAllIdents()

std::vector<std::string> mongo::DevNullKVEngine::getAllIdents ( OperationContext *  opCtx) const
inlinevirtual

Implements mongo::KVEngine.

◆ getIdentSize()

virtual int64_t mongo::DevNullKVEngine::getIdentSize ( OperationContext *  opCtx,
StringData  ident 
)
inlinevirtual

Implements mongo::KVEngine.

◆ getRecordStore()

std::unique_ptr< RecordStore > mongo::DevNullKVEngine::getRecordStore ( OperationContext *  opCtx,
StringData  ns,
StringData  ident,
const CollectionOptions options 
)
virtual

Having multiple out for the same ns is a rules violation; Calling on a non-created ident is invalid and may crash.

Implements mongo::KVEngine.

◆ getSortedDataInterface()

SortedDataInterface * mongo::DevNullKVEngine::getSortedDataInterface ( OperationContext *  opCtx,
StringData  ident,
const IndexDescriptor *  desc 
)
virtual

Implements mongo::KVEngine.

◆ hasIdent()

virtual bool mongo::DevNullKVEngine::hasIdent ( OperationContext *  opCtx,
StringData  ident 
) const
inlinevirtual

Implements mongo::KVEngine.

◆ isCacheUnderPressure()

bool mongo::DevNullKVEngine::isCacheUnderPressure ( OperationContext *  opCtx) const
overridevirtual

◆ isDurable()

virtual bool mongo::DevNullKVEngine::isDurable ( ) const
inlinevirtual

devnull does no journaling, so don't report the engine as durable.

Implements mongo::KVEngine.

◆ isEphemeral()

virtual bool mongo::DevNullKVEngine::isEphemeral ( ) const
inlinevirtual

Returns true if the KVEngine is ephemeral – that is, it is NOT persistent and all data is lost after shutdown.

Otherwise, returns false.

Implements mongo::KVEngine.

◆ newRecoveryUnit()

virtual RecoveryUnit* mongo::DevNullKVEngine::newRecoveryUnit ( )
inlinevirtual

Implements mongo::KVEngine.

◆ repairIdent()

virtual Status mongo::DevNullKVEngine::repairIdent ( OperationContext *  opCtx,
StringData  ident 
)
inlinevirtual

Implements mongo::KVEngine.

◆ setCachePressureForTest()

void mongo::DevNullKVEngine::setCachePressureForTest ( int  pressure)
overridevirtual

◆ setJournalListener()

void mongo::DevNullKVEngine::setJournalListener ( JournalListener jl)
inlinefinalvirtual

Sets a new JournalListener, which is used to alert the rest of the system about journaled write progress.

Implements mongo::KVEngine.

◆ supportsDirectoryPerDB()

virtual bool mongo::DevNullKVEngine::supportsDirectoryPerDB ( ) const
inlinevirtual

Returns true if storage engine supports –directoryperdb.

See: http://docs.mongodb.org/manual/reference/program/mongod/#cmdoption&ndash;directoryperdb

Implements mongo::KVEngine.

◆ supportsDocLocking()

virtual bool mongo::DevNullKVEngine::supportsDocLocking ( ) const
inlinevirtual

This must not change over the lifetime of the engine.

Implements mongo::KVEngine.

Member Data Documentation

◆ _cachePressureForTest

int mongo::DevNullKVEngine::_cachePressureForTest
private

◆ _catalogInfo

std::shared_ptr<void> mongo::DevNullKVEngine::_catalogInfo
private

The documentation for this class was generated from the following files: