mongo::dur::DurOp Class Reference

#include <durop.h>

Inheritance diagram for mongo::dur::DurOp:
Inheritance graph
[legend]

List of all members.

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< DurOpread (unsigned opcode, BufReader &br)

Protected Member Functions

virtual void _serialize (AlignedBuilder &ab)=0

Private Attributes

const unsigned _opcode

Detailed Description

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.


Constructor & Destructor Documentation

mongo::dur::DurOp::DurOp ( unsigned  opcode  )  [inline]

Definition at line 45 of file durop.h.

virtual mongo::dur::DurOp::~DurOp (  )  [inline, virtual]

Definition at line 47 of file durop.h.


Member Function Documentation

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.

Definition at line 68 of file durop.h.

static shared_ptr<DurOp> mongo::dur::DurOp::read ( unsigned  opcode,
BufReader br 
) [static]

read a durop from journal file referenced by br.

Parameters:
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]

Member Data Documentation

const unsigned mongo::dur::DurOp::_opcode [private]

Definition at line 75 of file durop.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


mongodb
Author(s): Nate Koenig
autogenerated on Fri Jan 11 12:15:59 2013