35 #include "mongo/base/checked_cast.h" 36 #include "mongo/db/operation_context.h" 37 #include "mongo/db/record_id.h" 42 #include "mongo/platform/atomic_word.h" 46 class SortedDataInterface;
88 return checked_cast<MobileRecoveryUnit*>(
opCtx->recoveryUnit());
114 using Changes = std::vector<std::unique_ptr<Change>>;
void beginUnitOfWork(OperationContext *opCtx) override
Marks the beginning of a unit of work.
Definition: mobile_recovery_unit.cpp:93
void _upgradeToWriteSession(OperationContext *opCtx)
Changes _changes
Definition: mobile_recovery_unit.h:115
void * writingPtr(void *data, size_t len) override
Declare that the data at [x, x + len) is being written.
Definition: mobile_recovery_unit.h:65
void commitUnitOfWork() override
Marks the end of a unit of work and commits all changes registered by calls to onCommit or registerCh...
Definition: mobile_recovery_unit.cpp:110
bool waitUntilDurable() override
Waits until all commits that happened before this call are durable in the journal.
Definition: mobile_recovery_unit.h:57
std::unique_ptr< MobileSession > _session
Definition: mobile_recovery_unit.h:112
void setRollbackWritesDisabled() override
Sets a flag that declares this RecoveryUnit will skip rolling back writes, for the duration of the cu...
Definition: mobile_recovery_unit.h:69
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
bool _areWriteUnitOfWorksBanned
Definition: mobile_recovery_unit.h:102
MobileSession * getSession(OperationContext *opCtx, bool readOnly=true)
Definition: mobile_recovery_unit.cpp:142
Definition: mobile_recovery_unit.h:48
SnapshotId getSnapshotId() const override
Gets the local SnapshotId.
Definition: mobile_recovery_unit.h:71
void _txnOpen(OperationContext *opCtx, bool readOnly)
Definition: mobile_recovery_unit.cpp:169
std::string _path
Definition: mobile_recovery_unit.h:110
void abandonSnapshot() override
If there is an open transaction, it is closed.
Definition: mobile_recovery_unit.cpp:128
void assertInActiveTxn() const
Definition: mobile_recovery_unit.cpp:158
std::shared_ptr< void > data
Definition: ephemeral_for_test_record_store_test.cpp:74
uint64_t _id
Definition: mobile_recovery_unit.h:107
void _txnClose(bool commit)
Definition: mobile_recovery_unit.cpp:207
void registerChange(Change *change) override
The RecoveryUnit takes ownership of the change.
Definition: mobile_recovery_unit.cpp:137
std::vector< std::unique_ptr< Change > > Changes
Definition: mobile_recovery_unit.h:114
bool _inUnitOfWork
Definition: mobile_recovery_unit.h:103
void enqueueFailedDrop(std::string &dropQuery)
Definition: mobile_recovery_unit.cpp:221
This class manages a SQLite database connection object.
Definition: mobile_session.h:43
void setOrderedCommit(bool orderedCommit) override
Definition: mobile_recovery_unit.h:91
bool inActiveTxn() const
Definition: mobile_recovery_unit.h:79
A RecoveryUnit is responsible for ensuring that data is persisted.
Definition: recovery_unit.h:51
void _commit()
Definition: mobile_recovery_unit.cpp:63
MobileSessionPool * _sessionPool
Definition: mobile_recovery_unit.h:111
bool _isReadOnly
Definition: mobile_recovery_unit.h:108
virtual ~MobileRecoveryUnit()
Definition: mobile_recovery_unit.cpp:57
void abortUnitOfWork() override
Marks the end of a unit of work and rolls back all changes registered by calls to onRollback or regis...
Definition: mobile_recovery_unit.cpp:119
This class manages a pool of open sqlite3* objects.
Definition: mobile_session_pool.h:66
MobileSession * getSessionNoTxn(OperationContext *opCtx)
Definition: mobile_recovery_unit.cpp:153
Definition: snapshot.h:37
void _ensureSession(OperationContext *opCtx)
Definition: mobile_recovery_unit.cpp:162
void _abort()
Definition: mobile_recovery_unit.cpp:78
static MobileRecoveryUnit * get(OperationContext *opCtx)
Definition: mobile_recovery_unit.h:87
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
bool _active
Definition: mobile_recovery_unit.h:104
MobileRecoveryUnit(MobileSessionPool *sessionPool)
Definition: mobile_recovery_unit.cpp:49
static AtomicInt64 _nextID
Definition: mobile_recovery_unit.h:106