Storage Engine API
mongo::StandardWiredTigerRecordStore Class Referencefinal

#include <wiredtiger_record_store.h>

Inheritance diagram for mongo::StandardWiredTigerRecordStore:
mongo::WiredTigerRecordStore mongo::RecordStore

Public Member Functions

 StandardWiredTigerRecordStore (WiredTigerKVEngine *kvEngine, OperationContext *opCtx, Params params)
 
virtual std::unique_ptr< SeekableRecordCursorgetCursor (OperationContext *opCtx, bool forward) const override
 Returns a new cursor over this record store. More...
 
virtual std::unique_ptr< RecordCursorgetRandomCursorWithOptions (OperationContext *opCtx, StringData extraConfig) const override
 
- Public Member Functions inherited from mongo::WiredTigerRecordStore
 WiredTigerRecordStore (WiredTigerKVEngine *kvEngine, OperationContext *opCtx, Params params)
 
virtual ~WiredTigerRecordStore ()
 
virtual void postConstructorInit (OperationContext *opCtx)
 
virtual const char * name () const
 
virtual long long dataSize (OperationContext *opCtx) const
 The dataSize is an approximation of the sum of the sizes (in bytes) of the documents or entries in the recordStore. More...
 
virtual long long numRecords (OperationContext *opCtx) const
 Total number of record in the RecordStore. More...
 
virtual bool isCapped () const
 
virtual int64_t storageSize (OperationContext *opCtx, BSONObjBuilder *extraInfo=NULL, int infoLevel=0) const
 
virtual RecordData dataFor (OperationContext *opCtx, const RecordId &id) const
 Get the RecordData at loc, which must exist. More...
 
virtual bool findRecord (OperationContext *opCtx, const RecordId &id, RecordData *out) const
 
virtual void deleteRecord (OperationContext *opCtx, const RecordId &id)
 
virtual Status insertRecords (OperationContext *opCtx, std::vector< Record > *records, std::vector< Timestamp > *timestamps, bool enforceQuota)
 
virtual StatusWith< RecordId > insertRecord (OperationContext *opCtx, const char *data, int len, Timestamp timestamp, bool enforceQuota)
 
virtual Status insertRecordsWithDocWriter (OperationContext *opCtx, const DocWriter *const *docs, const Timestamp *timestamps, size_t nDocs, RecordId *idsOut)
 Inserts nDocs documents into this RecordStore using the DocWriter interface. More...
 
virtual Status updateRecord (OperationContext *opCtx, const RecordId &oldLocation, const char *data, int len, bool enforceQuota, UpdateNotifier *notifier)
 
virtual bool updateWithDamagesSupported () const
 
virtual StatusWith< RecordDataupdateWithDamages (OperationContext *opCtx, const RecordId &id, const RecordData &oldRec, const char *damageSource, const mutablebson::DamageVector &damages)
 Updates the record positioned at 'loc' in-place using the deltas described by 'damages'. More...
 
std::unique_ptr< RecordCursorgetRandomCursor (OperationContext *opCtx) const final
 Constructs a cursor over a record store that returns documents in a randomized order, and allows storage engines to provide a more efficient way of random sampling of a record store than MongoDB's default sampling methods, which is used when this method returns {}. More...
 
std::vector< std::unique_ptr< RecordCursor > > getManyCursors (OperationContext *opCtx) const final
 Returns many RecordCursors that partition the RecordStore into many disjoint sets. More...
 
virtual Status truncate (OperationContext *opCtx)
 removes all Records More...
 
virtual bool compactSupported () const
 does this RecordStore support the compact operation? More...
 
virtual bool compactsInPlace () const
 Does compact() leave RecordIds alone or can they change. More...
 
virtual Status compact (OperationContext *opCtx, RecordStoreCompactAdaptor *adaptor, const CompactOptions *options, CompactStats *stats)
 Attempt to reduce the storage space used by this RecordStore. More...
 
virtual bool isInRecordIdOrder () const override
 Does the RecordStore cursor retrieve its document in RecordId Order? More...
 
virtual Status validate (OperationContext *opCtx, ValidateCmdLevel level, ValidateAdaptor *adaptor, ValidateResults *results, BSONObjBuilder *output)
 
virtual void appendCustomStats (OperationContext *opCtx, BSONObjBuilder *result, double scale) const
 
virtual Status touch (OperationContext *opCtx, BSONObjBuilder *output) const
 Load all data into cache. More...
 
virtual void cappedTruncateAfter (OperationContext *opCtx, RecordId end, bool inclusive)
 Truncate documents newer than the document at 'end' from the capped collection. More...
 
virtual boost::optional< RecordId > oplogStartHack (OperationContext *opCtx, const RecordId &startingPosition) const
 Return the RecordId of an oplog entry as close to startingPosition as possible without being higher. More...
 
virtual Status oplogDiskLocRegister (OperationContext *opCtx, const Timestamp &opTime, bool orderedCommit)
 When we write to an oplog, we call this so that if the storage engine supports doc locking, it can manage the visibility of oplog entries to ensure they are ordered. More...
 
virtual void updateStatsAfterRepair (OperationContext *opCtx, long long numRecords, long long dataSize)
 Called after a repair operation is run with the recomputed numRecords and dataSize. More...
 
void waitForAllEarlierOplogWritesToBeVisible (OperationContext *opCtx) const override
 Waits for all writes that completed before this call to be visible to forward scans. More...
 
Status updateCappedSize (OperationContext *opCtx, long long cappedSize) final
 used to support online change oplog size. More...
 
void setCappedCallback (CappedCallback *cb)
 
int64_t cappedMaxDocs () const
 
int64_t cappedMaxSize () const
 
const std::string & getURI () const
 
uint64_t tableId () const
 
void setSizeStorer (WiredTigerSizeStorer *ss)
 
bool isOpHidden_forTest (const RecordId &id) const
 
bool inShutdown () const
 
void reclaimOplog (OperationContext *opCtx)
 
void reclaimOplog (OperationContext *opCtx, Timestamp persistedTimestamp)
 The persistedTimestamp is when replication recovery would need to replay from on a restart. More...
 
int64_t cappedDeleteAsNeeded (OperationContext *opCtx, const RecordId &justInserted)
 
int64_t cappedDeleteAsNeeded_inlock (OperationContext *opCtx, const RecordId &justInserted)
 
bool yieldAndAwaitOplogDeletionRequest (OperationContext *opCtx)
 
bool haveCappedWaiters ()
 
void notifyCappedWaitersIfNeeded ()
 
OplogStonesoplogStones ()
 
- Public Member Functions inherited from mongo::RecordStore
 RecordStore (StringData ns)
 
virtual ~RecordStore ()
 
virtual const std::string & ns () const
 
StatusWith< RecordId > insertRecordWithDocWriter (OperationContext *opCtx, const DocWriter *doc, Timestamp timestamp)
 A thin wrapper around insertRecordsWithDocWriter() to simplify handling of single DocWriters. More...
 
virtual std::unique_ptr< RecordCursorgetCursorForRepair (OperationContext *opCtx) const
 Constructs a cursor over a potentially corrupted store, which can be used to salvage damaged records. More...
 

Protected Member Functions

virtual RecordId getKey (WT_CURSOR *cursor) const
 
virtual void setKey (WT_CURSOR *cursor, RecordId id) const
 

Additional Inherited Members

- Static Public Member Functions inherited from mongo::WiredTigerRecordStore
static StatusWith< std::string > parseOptionsField (const BSONObj options)
 Parses collections options for wired tiger configuration string for table creation. More...
 
static StatusWith< std::string > generateCreateString (const std::string &engineName, StringData ns, const CollectionOptions &options, StringData extraStrings, bool prefixed)
 Creates a configuration string suitable for 'config' parameter in WT_SESSION::create(). More...
 
- Protected Attributes inherited from mongo::RecordStore
std::string _ns
 

Constructor & Destructor Documentation

◆ StandardWiredTigerRecordStore()

mongo::StandardWiredTigerRecordStore::StandardWiredTigerRecordStore ( WiredTigerKVEngine kvEngine,
OperationContext *  opCtx,
Params  params 
)

Member Function Documentation

◆ getCursor()

std::unique_ptr< SeekableRecordCursor > mongo::StandardWiredTigerRecordStore::getCursor ( OperationContext *  opCtx,
bool  forward 
) const
overridevirtual

Returns a new cursor over this record store.

The cursor is logically positioned before the first (or last if !forward) Record in the collection so that Record will be returned on the first call to next(). Implementations are allowed to lazily seek to the first Record when next() is called rather than doing it on construction.

Implements mongo::WiredTigerRecordStore.

◆ getKey()

RecordId mongo::StandardWiredTigerRecordStore::getKey ( WT_CURSOR *  cursor) const
protectedvirtual

◆ getRandomCursorWithOptions()

std::unique_ptr< RecordCursor > mongo::StandardWiredTigerRecordStore::getRandomCursorWithOptions ( OperationContext *  opCtx,
StringData  extraConfig 
) const
overridevirtual

◆ setKey()

void mongo::StandardWiredTigerRecordStore::setKey ( WT_CURSOR *  cursor,
RecordId  id 
) const
protectedvirtual

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