35 #include "mongo/base/checked_cast.h" 36 #include "mongo/db/operation_context.h" 37 #include "mongo/db/record_id.h" 45 class SortedDataInterface;
98 void _txnOpen(OperationContext* opCtx);
108 using Changes = std::vector<std::unique_ptr<Change>>;
MobileSession * getSession(OperationContext *opCtx)
Definition: mobile_recovery_unit.cpp:111
void beginUnitOfWork(OperationContext *opCtx) override
Marks the beginning of a unit of work.
Definition: mobile_recovery_unit.cpp:79
Changes _changes
Definition: mobile_recovery_unit.h:109
void * writingPtr(void *data, size_t len) override
Declare that the data at [x, x + len) is being written.
Definition: mobile_recovery_unit.h:64
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:85
bool waitUntilDurable() override
Waits until all commits that happened before this call are durable in the journal.
Definition: mobile_recovery_unit.h:56
std::unique_ptr< MobileSession > _session
Definition: mobile_recovery_unit.h:106
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:68
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
bool _areWriteUnitOfWorksBanned
Definition: mobile_recovery_unit.h:100
Definition: mobile_recovery_unit.h:47
SnapshotId getSnapshotId() const override
Gets the local SnapshotId.
Definition: mobile_recovery_unit.h:70
std::string _path
Definition: mobile_recovery_unit.h:104
void abandonSnapshot() override
If there is an open transaction, it is closed.
Definition: mobile_recovery_unit.cpp:97
void assertInActiveTxn() const
Definition: mobile_recovery_unit.cpp:123
std::shared_ptr< void > data
Definition: ephemeral_for_test_record_store_test.cpp:74
void _txnClose(bool commit)
Definition: mobile_recovery_unit.cpp:151
void registerChange(Change *change) override
The RecoveryUnit takes ownership of the change.
Definition: mobile_recovery_unit.cpp:106
std::vector< std::unique_ptr< Change > > Changes
Definition: mobile_recovery_unit.h:108
bool _inUnitOfWork
Definition: mobile_recovery_unit.h:101
void enqueueFailedDrop(std::string &dropQuery)
Definition: mobile_recovery_unit.cpp:163
This class manages a SQLite database connection object.
Definition: mobile_session.h:43
void setOrderedCommit(bool orderedCommit) override
Definition: mobile_recovery_unit.h:90
bool inActiveTxn() const
Definition: mobile_recovery_unit.h:78
A RecoveryUnit is responsible for ensuring that data is persisted.
Definition: recovery_unit.h:51
void _commit()
Definition: mobile_recovery_unit.cpp:49
MobileSessionPool * _sessionPool
Definition: mobile_recovery_unit.h:105
virtual ~MobileRecoveryUnit()
Definition: mobile_recovery_unit.cpp:44
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:91
This class manages a pool of open sqlite3* objects.
Definition: mobile_session_pool.h:66
A Change is an action that is registerChange()'d while a WriteUnitOfWork exists.
Definition: recovery_unit.h:281
MobileSession * getSessionNoTxn(OperationContext *opCtx)
Definition: mobile_recovery_unit.cpp:118
void _txnOpen(OperationContext *opCtx)
Definition: mobile_recovery_unit.cpp:133
Definition: snapshot.h:37
void _ensureSession(OperationContext *opCtx)
Definition: mobile_recovery_unit.cpp:127
void _abort()
Definition: mobile_recovery_unit.cpp:64
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
bool _active
Definition: mobile_recovery_unit.h:102
MobileRecoveryUnit(MobileSessionPool *sessionPool)
Definition: mobile_recovery_unit.cpp:41