Storage Engine API
mongo::EphemeralForTestEngine Class Reference

#include <ephemeral_for_test_engine.h>

Inheritance diagram for mongo::EphemeralForTestEngine:
mongo::KVEngine

Public Member Functions

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 beginBackup (OperationContext *opCtx)
 See StorageEngine::beginBackup for details. More...
 
virtual void endBackup (OperationContext *opCtx)
 See StorageEngine::endBackup for details. More...
 
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
 Data stored in memory is not 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 int64_t getIdentSize (OperationContext *opCtx, StringData ident)
 
virtual Status repairIdent (OperationContext *opCtx, StringData ident)
 
virtual void cleanShutdown ()
 This method will be called before there is a clean shutdown. More...
 
virtual bool hasIdent (OperationContext *opCtx, StringData ident) const
 
std::vector< std::string > getAllIdents (OperationContext *opCtx) const
 
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 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 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 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 Types

typedef StringMap< std::shared_ptr< void > > DataMap
 

Private Attributes

stdx::mutex _mutex
 
DataMap _dataMap
 
JournalListener_journalListener = &NoOpJournalListener::instance
 

Member Typedef Documentation

◆ DataMap

typedef StringMap<std::shared_ptr<void> > mongo::EphemeralForTestEngine::DataMap
private

Member Function Documentation

◆ beginBackup()

virtual Status mongo::EphemeralForTestEngine::beginBackup ( OperationContext *  opCtx)
inlinevirtual

See StorageEngine::beginBackup for details.

Reimplemented from mongo::KVEngine.

◆ cleanShutdown()

virtual void mongo::EphemeralForTestEngine::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()

Status mongo::EphemeralForTestEngine::createRecordStore ( OperationContext *  opCtx,
StringData  ns,
StringData  ident,
const CollectionOptions options 
)
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.

Implements mongo::KVEngine.

◆ createSortedDataInterface()

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

Implements mongo::KVEngine.

◆ dropIdent()

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

Implements mongo::KVEngine.

◆ endBackup()

virtual void mongo::EphemeralForTestEngine::endBackup ( OperationContext *  opCtx)
inlinevirtual

See StorageEngine::endBackup for details.

Reimplemented from mongo::KVEngine.

◆ getAllCommittedTimestamp()

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

◆ getAllIdents()

std::vector< std::string > mongo::EphemeralForTestEngine::getAllIdents ( OperationContext *  opCtx) const
virtual

Implements mongo::KVEngine.

◆ getIdentSize()

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

Implements mongo::KVEngine.

◆ getRecordStore()

std::unique_ptr< RecordStore > mongo::EphemeralForTestEngine::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::EphemeralForTestEngine::getSortedDataInterface ( OperationContext *  opCtx,
StringData  ident,
const IndexDescriptor *  desc 
)
virtual

Implements mongo::KVEngine.

◆ hasIdent()

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

Implements mongo::KVEngine.

◆ isDurable()

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

Data stored in memory is not durable.

Implements mongo::KVEngine.

◆ isEphemeral()

virtual bool mongo::EphemeralForTestEngine::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()

RecoveryUnit * mongo::EphemeralForTestEngine::newRecoveryUnit ( )
virtual

Implements mongo::KVEngine.

◆ repairIdent()

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

Implements mongo::KVEngine.

◆ setJournalListener()

void mongo::EphemeralForTestEngine::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::EphemeralForTestEngine::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::EphemeralForTestEngine::supportsDocLocking ( ) const
inlinevirtual

This must not change over the lifetime of the engine.

Implements mongo::KVEngine.

Member Data Documentation

◆ _dataMap

DataMap mongo::EphemeralForTestEngine::_dataMap
private

◆ _journalListener

JournalListener* mongo::EphemeralForTestEngine::_journalListener = &NoOpJournalListener::instance
private

◆ _mutex

stdx::mutex mongo::EphemeralForTestEngine::_mutex
mutableprivate

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