Storage Engine API
mongo::dur::RecoveryJob Class Reference

call go() to execute a recovery from existing journal files. More...

#include <dur_recover.h>

Detailed Description

call go() to execute a recovery from existing journal files.

Classes

class  Last
 

Public Member Functions

 RecoveryJob ()
 
 ~RecoveryJob ()
 
void go (OperationContext *opCtx, std::vector< boost::filesystem::path > &files)
 
void processSection (OperationContext *opCtx, const JSectHeader *h, const void *data, unsigned len, const JSectFooter *f)
 
void close (OperationContext *opCtx)
 

Static Public Member Functions

static RecoveryJobget ()
 

Private Member Functions

 MONGO_DISALLOW_COPYING (RecoveryJob)
 
void write (Last &last, const ParsedJournalEntry &entry)
 
void applyEntry (Last &last, const ParsedJournalEntry &entry, bool apply, bool dump)
 
void applyEntries (OperationContext *opCtx, const std::vector< ParsedJournalEntry > &entries)
 
bool processFileBuffer (OperationContext *opCtx, const void *, unsigned len)
 apply a specific journal file, that is already mmap'd More...
 
bool processFile (OperationContext *opCtx, boost::filesystem::path journalfile)
 apply a specific journal file More...
 
void _close (OperationContext *opCtx)
 

Private Attributes

stdx::mutex _mx
 
std::list< std::shared_ptr< DurableMappedFile > > _mmfs
 
bool _recovering
 
unsigned long long _lastDataSyncedFromLastRun
 
unsigned long long _lastSeqSkipped
 
bool _appliedAnySections
 

Static Private Attributes

static RecoveryJob_instance = *(new RecoveryJob())
 

Constructor & Destructor Documentation

◆ RecoveryJob()

mongo::dur::RecoveryJob::RecoveryJob ( )

◆ ~RecoveryJob()

mongo::dur::RecoveryJob::~RecoveryJob ( )

Member Function Documentation

◆ _close()

void mongo::dur::RecoveryJob::_close ( OperationContext *  opCtx)
private

◆ applyEntries()

void mongo::dur::RecoveryJob::applyEntries ( OperationContext *  opCtx,
const std::vector< ParsedJournalEntry > &  entries 
)
private

◆ applyEntry()

void mongo::dur::RecoveryJob::applyEntry ( Last last,
const ParsedJournalEntry entry,
bool  apply,
bool  dump 
)
private

◆ close()

void mongo::dur::RecoveryJob::close ( OperationContext *  opCtx)

◆ get()

static RecoveryJob& mongo::dur::RecoveryJob::get ( )
inlinestatic

◆ go()

void mongo::dur::RecoveryJob::go ( OperationContext *  opCtx,
std::vector< boost::filesystem::path > &  files 
)
Parameters
filesall the j._0 style files we need to apply for recovery

◆ MONGO_DISALLOW_COPYING()

mongo::dur::RecoveryJob::MONGO_DISALLOW_COPYING ( RecoveryJob  )
private

◆ processFile()

bool mongo::dur::RecoveryJob::processFile ( OperationContext *  opCtx,
boost::filesystem::path  journalfile 
)
private

apply a specific journal file

◆ processFileBuffer()

bool mongo::dur::RecoveryJob::processFileBuffer ( OperationContext *  opCtx,
const void p,
unsigned  len 
)
private

apply a specific journal file, that is already mmap'd

Parameters
pstart of the memory mapped file
Returns
true if this is detected to be the last file (ends abruptly)

◆ processSection()

void mongo::dur::RecoveryJob::processSection ( OperationContext *  opCtx,
const JSectHeader h,
const void data,
unsigned  len,
const JSectFooter f 
)
Parameters
datadata between header and footer. compressed if recovering.

TEMP uncomment RARELY OCCASIONALLY { if( entries.capacity() > 2048 ) { entries.shrink_to_fit(); entries.reserve(2048); } }

◆ write()

void mongo::dur::RecoveryJob::write ( Last last,
const ParsedJournalEntry entry 
)
private

Member Data Documentation

◆ _appliedAnySections

bool mongo::dur::RecoveryJob::_appliedAnySections
private

◆ _instance

RecoveryJob & mongo::dur::RecoveryJob::_instance = *(new RecoveryJob())
staticprivate

◆ _lastDataSyncedFromLastRun

unsigned long long mongo::dur::RecoveryJob::_lastDataSyncedFromLastRun
private

◆ _lastSeqSkipped

unsigned long long mongo::dur::RecoveryJob::_lastSeqSkipped
private

◆ _mmfs

std::list<std::shared_ptr<DurableMappedFile> > mongo::dur::RecoveryJob::_mmfs
private

◆ _mx

stdx::mutex mongo::dur::RecoveryJob::_mx
private

◆ _recovering

bool mongo::dur::RecoveryJob::_recovering
private

The documentation for this class was generated from the following files: