#include <durop.h>
Public Member Functions | |
DurOp (unsigned opcode) | |
virtual bool | needFilesClosed () |
virtual void | replay ()=0 |
void | serialize (AlignedBuilder &ab) |
virtual string | toString ()=0 |
virtual | ~DurOp () |
Static Public Member Functions | |
static shared_ptr< DurOp > | read (unsigned opcode, BufReader &br) |
Protected Member Functions | |
virtual void | _serialize (AlignedBuilder &ab)=0 |
Private Attributes | |
const unsigned | _opcode |
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.
Definition at line 41 of file durop.h.
virtual void mongo::dur::DurOp::_serialize | ( | AlignedBuilder & | ab | ) | [protected, pure virtual] |
DurOp will have already written the opcode for you
Implemented in mongo::dur::FileCreatedOp, and mongo::dur::DropDbOp.
virtual bool mongo::dur::DurOp::needFilesClosed | ( | ) | [inline, virtual] |
if the op requires all file to be closed before doing its work, returns true.
Reimplemented in mongo::dur::FileCreatedOp, and mongo::dur::DropDbOp.
read a durop from journal file referenced by br.
opcode | the opcode which has already been written from the bufreader |
virtual void mongo::dur::DurOp::replay | ( | ) | [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::FileCreatedOp, and mongo::dur::DropDbOp.
void mongo::dur::DurOp::serialize | ( | AlignedBuilder & | ab | ) |
serialize the op out to a builder which will then be written (presumably) to the journal
virtual string mongo::dur::DurOp::toString | ( | ) | [pure virtual] |
Implemented in mongo::dur::FileCreatedOp, and mongo::dur::DropDbOp.
const unsigned mongo::dur::DurOp::_opcode [private] |