![]() |
Storage Engine API
|
DurOp - Operations we journal that aren't just basic writes. More...
#include <durop.h>
DurOp - Operations we journal that aren't just basic writes.
Basic writes are logged as JEntry's, and indicated in ram temporarily as struct dur::WriteIntent. We don't make WriteIntent inherit from DurOp to keep it as lean as possible as there will be millions of them (we don't want a vtable for example there).
For each op we want to journal, we define a subclass.
Public Member Functions | |
DurOp (unsigned opcode) | |
virtual | ~DurOp () |
void | serialize (AlignedBuilder &ab) |
serialize the op out to a builder which will then be written (presumably) to the journal More... | |
virtual void | replay ()=0 |
replay the operation (during recovery) throws More... | |
virtual std::string | toString ()=0 |
virtual bool | needFilesClosed () |
if the op requires all file to be closed before doing its work, returns true. More... | |
Static Public Member Functions | |
static std::shared_ptr< DurOp > | read (unsigned opcode, BufReader &br) |
read a durop from journal file referenced by br. More... | |
Protected Member Functions | |
virtual void | _serialize (AlignedBuilder &ab)=0 |
DurOp will have already written the opcode for you. More... | |
Private Attributes | |
const unsigned | _opcode |
|
inline |
|
inlinevirtual |
|
protectedpure virtual |
DurOp will have already written the opcode for you.
Implemented in mongo::dur::DropDbOp, and mongo::dur::FileCreatedOp.
|
inlinevirtual |
if the op requires all file to be closed before doing its work, returns true.
Reimplemented in mongo::dur::DropDbOp, and mongo::dur::FileCreatedOp.
|
static |
read a durop from journal file referenced by br.
opcode | the opcode which has already been written from the bufreader |
|
pure virtual |
replay the operation (during recovery) throws
For now, these are not replayed during the normal WRITETODATAFILES phase, since these operations are handled in other parts of the code. At some point this may change.
Implemented in mongo::dur::DropDbOp, and mongo::dur::FileCreatedOp.
void mongo::dur::DurOp::serialize | ( | AlignedBuilder & | ab | ) |
serialize the op out to a builder which will then be written (presumably) to the journal
|
pure virtual |
Implemented in mongo::dur::DropDbOp, and mongo::dur::FileCreatedOp.
|
private |