Storage Engine API
mongo::MobileKVEngine Class Reference

#include <mobile_kv_engine.h>

Inheritance diagram for mongo::MobileKVEngine:
mongo::KVEngine

Public Member Functions

 MobileKVEngine (const std::string &path)
 
RecoveryUnitnewRecoveryUnit () override
 
Status createRecordStore (OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options) override
 The create and drop methods on KVEngine are not transactional. More...
 
std::unique_ptr< RecordStoregetRecordStore (OperationContext *opCtx, StringData ns, StringData ident, const CollectionOptions &options) override
 Having multiple out for the same ns is a rules violation; Calling on a non-created ident is invalid and may crash. More...
 
Status createSortedDataInterface (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc) override
 
SortedDataInterfacegetSortedDataInterface (OperationContext *opCtx, StringData ident, const IndexDescriptor *desc) override
 
Status beginBackup (OperationContext *opCtx) override
 See StorageEngine::beginBackup for details. More...
 
void endBackup (OperationContext *opCtx) override
 See StorageEngine::endBackup for details. More...
 
Status dropIdent (OperationContext *opCtx, StringData ident) override
 
bool supportsDocLocking () const override
 This must not change over the lifetime of the engine. More...
 
bool supportsDBLocking () const override
 This must not change over the lifetime of the engine. More...
 
bool supportsCappedCollections () const override
 This must not change over the lifetime of the engine. More...
 
bool supportsDirectoryPerDB () const override
 Returns true if storage engine supports –directoryperdb. More...
 
bool isDurable () const override
 
int flushAllFiles (OperationContext *opCtx, bool sync) override
 Flush is a no-op since SQLite transactions are durable by default after each commit. More...
 
bool isEphemeral () const override
 Returns true if the KVEngine is ephemeral – that is, it is NOT persistent and all data is lost after shutdown. More...
 
int64_t getIdentSize (OperationContext *opCtx, StringData ident) override
 Note: this counts the total number of bytes in the key and value columns, not the actual number of bytes on disk used by this ident. More...
 
Status repairIdent (OperationContext *opCtx, StringData ident) override
 
void cleanShutdown () override
 This method will be called before there is a clean shutdown. More...
 
bool hasIdent (OperationContext *opCtx, StringData ident) const override
 
std::vector< std::string > getAllIdents (OperationContext *opCtx) const override
 
void setJournalListener (JournalListener *jl) override
 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 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 Member Functions

void _initDBPath (const std::string &path)
 

Private Attributes

stdx::mutex _mutex
 
std::unique_ptr< MobileSessionPool_sessionPool
 
JournalListener_journalListener = &NoOpJournalListener::instance
 
std::string _path
 

Constructor & Destructor Documentation

◆ MobileKVEngine()

mongo::MobileKVEngine::MobileKVEngine ( const std::string &  path)

Member Function Documentation

◆ _initDBPath()

void mongo::MobileKVEngine::_initDBPath ( const std::string &  path)
private

◆ beginBackup()

Status mongo::MobileKVEngine::beginBackup ( OperationContext *  opCtx)
inlineoverridevirtual

See StorageEngine::beginBackup for details.

Reimplemented from mongo::KVEngine.

◆ cleanShutdown()

void mongo::MobileKVEngine::cleanShutdown ( )
inlineoverridevirtual

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::MobileKVEngine::createRecordStore ( OperationContext *  opCtx,
StringData  ns,
StringData  ident,
const CollectionOptions options 
)
overridevirtual

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::MobileKVEngine::createSortedDataInterface ( OperationContext *  opCtx,
StringData  ident,
const IndexDescriptor *  desc 
)
overridevirtual

Implements mongo::KVEngine.

◆ dropIdent()

Status mongo::MobileKVEngine::dropIdent ( OperationContext *  opCtx,
StringData  ident 
)
overridevirtual

Implements mongo::KVEngine.

◆ endBackup()

void mongo::MobileKVEngine::endBackup ( OperationContext *  opCtx)
inlineoverridevirtual

See StorageEngine::endBackup for details.

Reimplemented from mongo::KVEngine.

◆ flushAllFiles()

int mongo::MobileKVEngine::flushAllFiles ( OperationContext *  opCtx,
bool  sync 
)
inlineoverridevirtual

Flush is a no-op since SQLite transactions are durable by default after each commit.

Reimplemented from mongo::KVEngine.

◆ getAllCommittedTimestamp()

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

◆ getAllIdents()

std::vector< std::string > mongo::MobileKVEngine::getAllIdents ( OperationContext *  opCtx) const
overridevirtual

Implements mongo::KVEngine.

◆ getIdentSize()

int64_t mongo::MobileKVEngine::getIdentSize ( OperationContext *  opCtx,
StringData  ident 
)
overridevirtual

Note: this counts the total number of bytes in the key and value columns, not the actual number of bytes on disk used by this ident.

Implements mongo::KVEngine.

◆ getRecordStore()

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

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::MobileKVEngine::getSortedDataInterface ( OperationContext *  opCtx,
StringData  ident,
const IndexDescriptor *  desc 
)
overridevirtual

Implements mongo::KVEngine.

◆ hasIdent()

bool mongo::MobileKVEngine::hasIdent ( OperationContext *  opCtx,
StringData  ident 
) const
overridevirtual

Implements mongo::KVEngine.

◆ isDurable()

bool mongo::MobileKVEngine::isDurable ( ) const
inlineoverridevirtual

Implements mongo::KVEngine.

◆ isEphemeral()

bool mongo::MobileKVEngine::isEphemeral ( ) const
inlineoverridevirtual

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::MobileKVEngine::newRecoveryUnit ( )
overridevirtual

Implements mongo::KVEngine.

◆ repairIdent()

Status mongo::MobileKVEngine::repairIdent ( OperationContext *  opCtx,
StringData  ident 
)
inlineoverridevirtual

Implements mongo::KVEngine.

◆ setJournalListener()

void mongo::MobileKVEngine::setJournalListener ( JournalListener jl)
inlineoverridevirtual

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

Implements mongo::KVEngine.

◆ supportsCappedCollections()

bool mongo::MobileKVEngine::supportsCappedCollections ( ) const
inlineoverridevirtual

This must not change over the lifetime of the engine.

Reimplemented from mongo::KVEngine.

◆ supportsDBLocking()

bool mongo::MobileKVEngine::supportsDBLocking ( ) const
inlineoverridevirtual

This must not change over the lifetime of the engine.

Reimplemented from mongo::KVEngine.

◆ supportsDirectoryPerDB()

bool mongo::MobileKVEngine::supportsDirectoryPerDB ( ) const
inlineoverridevirtual

Returns true if storage engine supports –directoryperdb.

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

Implements mongo::KVEngine.

◆ supportsDocLocking()

bool mongo::MobileKVEngine::supportsDocLocking ( ) const
inlineoverridevirtual

This must not change over the lifetime of the engine.

Implements mongo::KVEngine.

Member Data Documentation

◆ _journalListener

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

◆ _mutex

stdx::mutex mongo::MobileKVEngine::_mutex
mutableprivate

◆ _path

std::string mongo::MobileKVEngine::_path
private

◆ _sessionPool

std::unique_ptr<MobileSessionPool> mongo::MobileKVEngine::_sessionPool
private

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