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

Tracks all write operations on the private view so they can be journaled. More...

#include <dur_commitjob.h>

Detailed Description

Tracks all write operations on the private view so they can be journaled.

Public Member Functions

 CommitJob ()
 
 ~CommitJob ()
 
void noteOp (std::shared_ptr< DurOp > p)
 Note an operation other than a "basic write". More...
 
void note (void *p, int len)
 Record/note an intent to write. More...
 
bool hasWritten () const
 When this value is false we don't have to do any group commit. More...
 
void committingReset ()
 We use the commitjob object over and over, calling committingReset() rather than reconstructing. More...
 
size_t bytes () const
 We check how much written and if it is getting to be a lot, we commit sooner. More...
 
const WriteIntentsVectorgetIntentsSorted ()
 Sorts the internal list of write intents so that overlapping and duplicate items can be merged. More...
 
const DurOpsVectorops () const
 

Public Attributes

SimpleMutex groupCommitMutex
 

Private Member Functions

 MONGO_DISALLOW_COPYING (CommitJob)
 
void _insertWriteIntent (void *p, int len)
 

Private Attributes

bool _hasWritten
 
Already< 127 > _alreadyNoted
 
WriteIntentsVector _intents
 
DurOpsVector _durOps
 
size_t _lastNotedPos
 
size_t _bytes
 
uint64_t _lastComplainMs
 
unsigned _complains
 

Constructor & Destructor Documentation

◆ CommitJob()

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

◆ ~CommitJob()

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

Member Function Documentation

◆ _insertWriteIntent()

void mongo::dur::CommitJob::_insertWriteIntent ( void p,
int  len 
)
inlineprivate

◆ bytes()

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.

◆ committingReset()

void mongo::dur::CommitJob::committingReset ( )

We use the commitjob object over and over, calling committingReset() rather than reconstructing.

◆ getIntentsSorted()

const WriteIntentsVector& mongo::dur::CommitJob::getIntentsSorted ( )
inline

Sorts the internal list of write intents so that overlapping and duplicate items can be merged.

We do the sort here so the caller receives something they must keep const from their POV.

◆ hasWritten()

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

When this value is false we don't have to do any group commit.

◆ MONGO_DISALLOW_COPYING()

mongo::dur::CommitJob::MONGO_DISALLOW_COPYING ( CommitJob  )
private

◆ note()

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

Record/note an intent to write.

NOTE: Not thread safe. Requires the mutex to be locked.

◆ noteOp()

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

Note an operation other than a "basic write".

◆ ops()

const DurOpsVector& mongo::dur::CommitJob::ops ( ) const
inline

Member Data Documentation

◆ _alreadyNoted

Already<127> mongo::dur::CommitJob::_alreadyNoted
private

◆ _bytes

size_t mongo::dur::CommitJob::_bytes
private

◆ _complains

unsigned mongo::dur::CommitJob::_complains
private

◆ _durOps

DurOpsVector mongo::dur::CommitJob::_durOps
private

◆ _hasWritten

bool mongo::dur::CommitJob::_hasWritten
private

◆ _intents

WriteIntentsVector mongo::dur::CommitJob::_intents
private

◆ _lastComplainMs

uint64_t mongo::dur::CommitJob::_lastComplainMs
private

◆ _lastNotedPos

size_t mongo::dur::CommitJob::_lastNotedPos
private

◆ groupCommitMutex

SimpleMutex mongo::dur::CommitJob::groupCommitMutex

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