Storage Engine API
mongo::SnapshotManager Class Referenceabstract

Manages snapshots that can be read from at a later time. More...

#include <snapshot_manager.h>

Inheritance diagram for mongo::SnapshotManager:
mongo::WiredTigerSnapshotManager

Detailed Description

Manages snapshots that can be read from at a later time.

Implementations must be able to handle concurrent access to any methods. No methods are allowed to acquire locks from the LockManager.

Public Member Functions

virtual void setCommittedSnapshot (const Timestamp &timestamp)=0
 Sets the snapshot to be used for committed reads. More...
 
virtual void setLocalSnapshot (const Timestamp &timestamp)=0
 Sets the snapshot for the last stable timestamp for reading on secondaries. More...
 
virtual boost::optional< Timestamp > getLocalSnapshot ()=0
 Returns the local snapshot timestamp. More...
 
virtual void dropAllSnapshots ()=0
 Drops all snapshots and clears the "committed" snapshot. More...
 

Protected Member Functions

virtual ~SnapshotManager ()=default
 SnapshotManagers are not intended to be deleted through pointers to base type. More...
 

Constructor & Destructor Documentation

◆ ~SnapshotManager()

virtual mongo::SnapshotManager::~SnapshotManager ( )
protectedvirtualdefault

SnapshotManagers are not intended to be deleted through pointers to base type.

(virtual is just to suppress compiler warnings)

Member Function Documentation

◆ dropAllSnapshots()

virtual void mongo::SnapshotManager::dropAllSnapshots ( )
pure virtual

Drops all snapshots and clears the "committed" snapshot.

Implemented in mongo::WiredTigerSnapshotManager.

◆ getLocalSnapshot()

virtual boost::optional<Timestamp> mongo::SnapshotManager::getLocalSnapshot ( )
pure virtual

Returns the local snapshot timestamp.

Implemented in mongo::WiredTigerSnapshotManager.

◆ setCommittedSnapshot()

virtual void mongo::SnapshotManager::setCommittedSnapshot ( const Timestamp &  timestamp)
pure virtual

Sets the snapshot to be used for committed reads.

Implementations are allowed to assume that all older snapshots have names that compare less than the passed in name, and newer ones compare greater.

This is called while holding a very hot mutex. Therefore it should avoid doing any work that can be done later.

Implemented in mongo::WiredTigerSnapshotManager.

◆ setLocalSnapshot()

virtual void mongo::SnapshotManager::setLocalSnapshot ( const Timestamp &  timestamp)
pure virtual

Sets the snapshot for the last stable timestamp for reading on secondaries.

Implemented in mongo::WiredTigerSnapshotManager.


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