![]() |
Storage Engine API
|
A Change is an action that is registerChange()'d while a WriteUnitOfWork exists. More...
#include <recovery_unit.h>
A Change is an action that is registerChange()'d while a WriteUnitOfWork exists.
The change is either rollback()'d or commit()'d when the WriteUnitOfWork goes out of scope.
Neither rollback() nor commit() may fail or throw exceptions.
Change implementors are responsible for handling their own locking, and must be aware that rollback() and commit() may be called after resources with a shorter lifetime than the WriteUnitOfWork have been freed. Each registered change will be committed or rolled back once.
commit() handlers are passed the timestamp at which the transaction is committed. If the transaction is not committed at a particular timestamp, or if the storage engine does not support timestamps, then boost::none will be supplied for this parameter.
Public Member Functions | |
virtual | ~Change () |
virtual void | rollback ()=0 |
virtual void | commit (boost::optional< Timestamp > commitTime)=0 |
|
inlinevirtual |
|
pure virtual |
Implemented in mongo::WiredTigerRecordStore::DataSizeChange, mongo::WiredTigerRecordStore::NumRecordsChange, mongo::MobileRecordStore::DataSizeChange, mongo::MobileRecordStore::NumRecsChange, mongo::IndexCatalogEntryImpl::SetHeadChange, mongo::KVCatalog::RemoveIdentChange, mongo::MMAPV1DatabaseCatalogEntry::EntryRemoval, mongo::DatabaseImpl::RemoveCollectionChange, mongo::WiredTigerRecordStore::OplogStones::TruncateChange, mongo::KVCatalog::AddIdentChange, mongo::MMAPV1DatabaseCatalogEntry::EntryInsertion, mongo::MultiIndexBlockImpl::CleanupIndexesVectorOnRollback, mongo::WiredTigerRecordStore::OplogStones::InsertChange, mongo::DatabaseImpl::AddCollectionChange, mongo::EphemeralForTestRecordStore::TruncateChange, mongo::BtreeLogic< BtreeLayout >::Builder::SetRightLeafLocChange< BtreeLayout >, mongo::MultiIndexBlockImpl::SetNeedToCleanupOnRollback, mongo::KVDatabaseCatalogEntryBase::RemoveCollectionChange, mongo::EphemeralForTestRecordStore::RemoveChange, mongo::KVCollectionCatalogEntry::RemoveIndexChange, mongo::KVStorageEngine::RemoveDBChange, mongo::KVDatabaseCatalogEntryBase::AddCollectionChange, mongo::KVCollectionCatalogEntry::AddIndexChange, and mongo::EphemeralForTestRecordStore::InsertChange.
|
pure virtual |
Implemented in mongo::WiredTigerRecordStore::DataSizeChange, mongo::WiredTigerRecordStore::NumRecordsChange, mongo::MobileRecordStore::DataSizeChange, mongo::MobileRecordStore::NumRecsChange, mongo::IndexCatalogEntryImpl::SetHeadChange, mongo::KVCatalog::RemoveIdentChange, mongo::WiredTigerRecordStore::OplogStones::TruncateChange, mongo::DatabaseImpl::RemoveCollectionChange, mongo::MMAPV1DatabaseCatalogEntry::EntryRemoval, mongo::KVCatalog::AddIdentChange, mongo::WiredTigerRecordStore::OplogStones::InsertChange, mongo::DatabaseImpl::AddCollectionChange, mongo::MultiIndexBlockImpl::CleanupIndexesVectorOnRollback, mongo::MMAPV1DatabaseCatalogEntry::EntryInsertion, mongo::EphemeralForTestRecordStore::TruncateChange, mongo::BtreeLogic< BtreeLayout >::Builder::SetRightLeafLocChange< BtreeLayout >, mongo::KVDatabaseCatalogEntryBase::RemoveCollectionChange, mongo::MultiIndexBlockImpl::SetNeedToCleanupOnRollback, mongo::EphemeralForTestRecordStore::RemoveChange, mongo::KVCollectionCatalogEntry::RemoveIndexChange, mongo::KVStorageEngine::RemoveDBChange, mongo::KVDatabaseCatalogEntryBase::AddCollectionChange, mongo::KVCollectionCatalogEntry::AddIndexChange, and mongo::EphemeralForTestRecordStore::InsertChange.