mongo::dur::CommitJob Class Reference

#include <dur_commitjob.h>

List of all members.

Public Member Functions

void awaitNextCommit ()
size_t bytes () const
 CommitJob ()
bool hasWritten () const
void note (void *p, int len)
void noteOp (shared_ptr< DurOp > p)
void notifyCommitted ()
vector< shared_ptr< DurOp > > & ops ()
void reset ()
Writeswi ()
set< WriteIntent > & writes ()

Public Attributes

AlignedBuilder _ab
unsigned _nSinceCommitIfNeededCall

Private Attributes

size_t _bytes
bool _hasWritten
NotifyAll _notify
Writes _wi

Detailed Description

A commit job object for a group commit. Currently there is one instance of this object.

concurrency: assumption is caller is appropriately locking. for example note() invocations are from the write lock. other uses are in a read lock from a single thread (durThread)

Definition at line 157 of file dur_commitjob.h.


Constructor & Destructor Documentation

mongo::dur::CommitJob::CommitJob (  ) 

Member Function Documentation

void mongo::dur::CommitJob::awaitNextCommit (  )  [inline]

Wait until the next group commit occurs. That is, wait until someone calls notifyCommitted.

Definition at line 192 of file dur_commitjob.h.

size_t mongo::dur::CommitJob::bytes (  )  const [inline]

we check how much written and if it is getting to be a lot, we commit sooner.

Definition at line 198 of file dur_commitjob.h.

bool mongo::dur::CommitJob::hasWritten (  )  const [inline]

this method is safe to call outside of locks. when haswritten is false we don't do any group commit and avoid even trying to acquire a lock, which might be helpful at times.

Definition at line 183 of file dur_commitjob.h.

void mongo::dur::CommitJob::note ( void *  p,
int  len 
)

record/note an intent to write

void mongo::dur::CommitJob::noteOp ( shared_ptr< DurOp p  ) 

note an operation other than a "basic write"

void mongo::dur::CommitJob::notifyCommitted (  )  [inline]

the commit code calls this when data reaches the journal (on disk)

Definition at line 189 of file dur_commitjob.h.

vector< shared_ptr<DurOp> >& mongo::dur::CommitJob::ops (  )  [inline]

Definition at line 178 of file dur_commitjob.h.

void mongo::dur::CommitJob::reset (  ) 

we use the commitjob object over and over, calling reset() rather than reconstructing

Writes& mongo::dur::CommitJob::wi (  )  [inline]

Definition at line 204 of file dur_commitjob.h.

set<WriteIntent>& mongo::dur::CommitJob::writes (  )  [inline]

Definition at line 169 of file dur_commitjob.h.


Member Data Documentation

Definition at line 159 of file dur_commitjob.h.

Definition at line 208 of file dur_commitjob.h.

Definition at line 206 of file dur_commitjob.h.

Definition at line 209 of file dur_commitjob.h.

Definition at line 211 of file dur_commitjob.h.

Definition at line 207 of file dur_commitjob.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:58 2013