Storage Engine API
mongo::WiredTigerRecordStore::OplogStones Class Reference

#include <wiredtiger_record_store_oplog_stones.h>

Classes

class  InsertChange
 
struct  Stone
 
class  TruncateChange
 

Public Member Functions

 OplogStones (OperationContext *opCtx, WiredTigerRecordStore *rs)
 
bool isDead ()
 
void kill ()
 
bool hasExcessStones_inlock () const
 
void awaitHasExcessStonesOrDead ()
 
boost::optional< OplogStones::StonepeekOldestStoneIfNeeded () const
 
void popOldestStone ()
 
void createNewStoneIfNeeded (RecordId lastRecord)
 
void updateCurrentStoneAfterInsertOnCommit (OperationContext *opCtx, int64_t bytesInserted, RecordId highestInserted, int64_t countInserted)
 
void clearStonesOnCommit (OperationContext *opCtx)
 
void updateStonesAfterCappedTruncateAfter (int64_t recordsRemoved, int64_t bytesRemoved, RecordId firstRemovedId)
 
void adjust (int64_t maxSize)
 
size_t numStones () const
 
int64_t currentBytes () const
 
int64_t currentRecords () const
 
void setMinBytesPerStone (int64_t size)
 

Public Attributes

RecordId firstRecord
 

Private Member Functions

void _calculateStones (OperationContext *opCtx, size_t size)
 
void _calculateStonesByScanning (OperationContext *opCtx)
 
void _calculateStonesBySampling (OperationContext *opCtx, int64_t estRecordsPerStone, int64_t estBytesPerStone)
 
void _pokeReclaimThreadIfNeeded ()
 

Private Attributes

WiredTigerRecordStore_rs
 
stdx::mutex _oplogReclaimMutex
 
stdx::condition_variable _oplogReclaimCv
 
bool _isDead = false
 
int64_t _minBytesPerStone
 
AtomicInt64 _currentRecords
 
AtomicInt64 _currentBytes
 
stdx::mutex _mutex
 
std::deque< OplogStones::Stone_stones
 

Static Private Attributes

static const uint64_t kRandomSamplesPerStone = 10
 

Constructor & Destructor Documentation

◆ OplogStones()

mongo::WiredTigerRecordStore::OplogStones::OplogStones ( OperationContext *  opCtx,
WiredTigerRecordStore rs 
)

Member Function Documentation

◆ _calculateStones()

void mongo::WiredTigerRecordStore::OplogStones::_calculateStones ( OperationContext *  opCtx,
size_t  size 
)
private

◆ _calculateStonesBySampling()

void mongo::WiredTigerRecordStore::OplogStones::_calculateStonesBySampling ( OperationContext *  opCtx,
int64_t  estRecordsPerStone,
int64_t  estBytesPerStone 
)
private

◆ _calculateStonesByScanning()

void mongo::WiredTigerRecordStore::OplogStones::_calculateStonesByScanning ( OperationContext *  opCtx)
private

◆ _pokeReclaimThreadIfNeeded()

void mongo::WiredTigerRecordStore::OplogStones::_pokeReclaimThreadIfNeeded ( )
private

◆ adjust()

void mongo::WiredTigerRecordStore::OplogStones::adjust ( int64_t  maxSize)

◆ awaitHasExcessStonesOrDead()

void mongo::WiredTigerRecordStore::OplogStones::awaitHasExcessStonesOrDead ( )

◆ clearStonesOnCommit()

void mongo::WiredTigerRecordStore::OplogStones::clearStonesOnCommit ( OperationContext *  opCtx)

◆ createNewStoneIfNeeded()

void mongo::WiredTigerRecordStore::OplogStones::createNewStoneIfNeeded ( RecordId  lastRecord)

◆ currentBytes()

int64_t mongo::WiredTigerRecordStore::OplogStones::currentBytes ( ) const
inline

◆ currentRecords()

int64_t mongo::WiredTigerRecordStore::OplogStones::currentRecords ( ) const
inline

◆ hasExcessStones_inlock()

bool mongo::WiredTigerRecordStore::OplogStones::hasExcessStones_inlock ( ) const
inline

◆ isDead()

bool mongo::WiredTigerRecordStore::OplogStones::isDead ( )

◆ kill()

void mongo::WiredTigerRecordStore::OplogStones::kill ( )

◆ numStones()

size_t mongo::WiredTigerRecordStore::OplogStones::numStones ( ) const
inline

◆ peekOldestStoneIfNeeded()

boost::optional< WiredTigerRecordStore::OplogStones::Stone > mongo::WiredTigerRecordStore::OplogStones::peekOldestStoneIfNeeded ( ) const

◆ popOldestStone()

void mongo::WiredTigerRecordStore::OplogStones::popOldestStone ( )

◆ setMinBytesPerStone()

void mongo::WiredTigerRecordStore::OplogStones::setMinBytesPerStone ( int64_t  size)

◆ updateCurrentStoneAfterInsertOnCommit()

void mongo::WiredTigerRecordStore::OplogStones::updateCurrentStoneAfterInsertOnCommit ( OperationContext *  opCtx,
int64_t  bytesInserted,
RecordId  highestInserted,
int64_t  countInserted 
)

◆ updateStonesAfterCappedTruncateAfter()

void mongo::WiredTigerRecordStore::OplogStones::updateStonesAfterCappedTruncateAfter ( int64_t  recordsRemoved,
int64_t  bytesRemoved,
RecordId  firstRemovedId 
)

Member Data Documentation

◆ _currentBytes

AtomicInt64 mongo::WiredTigerRecordStore::OplogStones::_currentBytes
private

◆ _currentRecords

AtomicInt64 mongo::WiredTigerRecordStore::OplogStones::_currentRecords
private

◆ _isDead

bool mongo::WiredTigerRecordStore::OplogStones::_isDead = false
private

◆ _minBytesPerStone

int64_t mongo::WiredTigerRecordStore::OplogStones::_minBytesPerStone
private

◆ _mutex

stdx::mutex mongo::WiredTigerRecordStore::OplogStones::_mutex
mutableprivate

◆ _oplogReclaimCv

stdx::condition_variable mongo::WiredTigerRecordStore::OplogStones::_oplogReclaimCv
private

◆ _oplogReclaimMutex

stdx::mutex mongo::WiredTigerRecordStore::OplogStones::_oplogReclaimMutex
private

◆ _rs

WiredTigerRecordStore* mongo::WiredTigerRecordStore::OplogStones::_rs
private

◆ _stones

std::deque<OplogStones::Stone> mongo::WiredTigerRecordStore::OplogStones::_stones
private

◆ firstRecord

RecordId mongo::WiredTigerRecordStore::OplogStones::firstRecord

◆ kRandomSamplesPerStone

const uint64_t mongo::WiredTigerRecordStore::OplogStones::kRandomSamplesPerStone = 10
staticprivate

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