34 #include "mongo/base/owned_pointer_vector.h" 36 #include "mongo/platform/compiler.h" 60 virtual void*
writingPtr(
void* addr,
size_t len);
119 Write(
char* addr,
int len,
int offset) : addr(addr), len(len), offset(offset) {}
123 return addr < rhs.
addr;
size_t _writeBytes
Definition: dur_recovery_unit.h:112
void commitUnitOfWork() final
Marks the end of a unit of work and commits all changes registered by calls to onCommit or registerCh...
Definition: dur_recovery_unit.cpp:56
int len
Definition: dur_recovery_unit.h:137
virtual SnapshotId getSnapshotId() const
Gets the local SnapshotId.
Definition: dur_recovery_unit.h:64
char * addr
Definition: dur_recovery_unit.h:136
std::set< Write, Write::compareEnd > MergedWrites
Writes are ordered by ending address, so MergedWrites::upper_bound() can find the first overlapping w...
Definition: dur_recovery_unit.h:148
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
std::string _preimageBuffer
Definition: dur_recovery_unit.h:160
size_t _writeCount
Definition: dur_recovery_unit.h:110
InitialWrites _initialWrites
Definition: dur_recovery_unit.h:158
Write(char *addr, int len, int offset)
Definition: dur_recovery_unit.h:119
void commitChanges()
Marks writes for journaling, if enabled, and then commits all other Changes in order.
Definition: dur_recovery_unit.cpp:79
virtual void abandonSnapshot()
If there is an open transaction, it is closed.
Definition: dur_recovery_unit.cpp:74
Definition: dur_recovery_unit.h:126
void mergingWritingPtr(char *data, size_t len)
Version of writingPtr that checks existing writes for overlap and only stores those changes not yet c...
Definition: dur_recovery_unit.cpp:204
bool operator()(const Write &lhs, const Write &rhs) const
Definition: dur_recovery_unit.h:127
std::vector< Write > InitialWrites
Definition: dur_recovery_unit.h:157
Write(const Write &rhs)
Definition: dur_recovery_unit.h:120
std::shared_ptr< void > data
Definition: ephemeral_for_test_record_store_test.cpp:74
DurRecoveryUnit()
Definition: dur_recovery_unit.cpp:48
virtual void setRollbackWritesDisabled()
Sets a flag that declares this RecoveryUnit will skip rolling back writes, for the duration of the cu...
Definition: dur_recovery_unit.cpp:306
char * end() const
Definition: dur_recovery_unit.h:132
OwnedPointerVector< Change > Changes
Definition: dur_recovery_unit.h:104
These are memory writes inside the mmapv1 mmap-ed files.
Definition: dur_recovery_unit.h:118
A RecoveryUnit is responsible for ensuring that data is persisted.
Definition: recovery_unit.h:51
virtual void registerChange(Change *change)
The RecoveryUnit takes ownership of the change.
Definition: dur_recovery_unit.cpp:311
virtual bool waitUntilDurable()
Waits until all commits that happened before this call are durable in the journal.
Definition: dur_recovery_unit.cpp:199
void markWritesForJournaling()
Creates a list of write intents to be journaled, and hands it of to the active DurabilityInterface.
Definition: dur_recovery_unit.cpp:92
void rollbackChanges()
Restores state by rolling back all writes using the saved pre-images, and then rolling back all other...
Definition: dur_recovery_unit.cpp:164
Just pass through to getDur().
Definition: dur_recovery_unit.h:45
void resetChanges()
Reset to a clean state without any uncommitted changes or write.
Definition: dur_recovery_unit.cpp:153
virtual void setOrderedCommit(bool orderedCommit)
Definition: dur_recovery_unit.h:68
A Change is an action that is registerChange()'d while a WriteUnitOfWork exists.
Definition: recovery_unit.h:281
void abortUnitOfWork() final
Marks the end of a unit of work and rolls back all changes registered by calls to onRollback or regis...
Definition: dur_recovery_unit.cpp:67
Definition: snapshot.h:37
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
bool _rollbackWritesDisabled
Definition: dur_recovery_unit.h:168
void beginUnitOfWork(OperationContext *opCtx) final
Marks the beginning of a unit of work.
Definition: dur_recovery_unit.cpp:51
virtual void * writingPtr(void *addr, size_t len)
Declare that the data at [x, x + len) is being written.
Definition: dur_recovery_unit.cpp:260
Write()
Definition: dur_recovery_unit.h:121
bool operator<(const Write &rhs) const
Definition: dur_recovery_unit.h:122
int offset
Definition: dur_recovery_unit.h:138
bool _inUnitOfWork
Definition: dur_recovery_unit.h:162
Changes _changes
Definition: dur_recovery_unit.h:105
MergedWrites _mergedWrites
Definition: dur_recovery_unit.h:149