33 #include <boost/shared_array.hpp> 63 OperationContext*
opCtx,
const char*
data,
int len, Timestamp,
bool enforceQuota);
82 const RecordId& oldLocation,
97 const char* damageSource,
98 const mutablebson::DamageVector& damages) {
103 bool forward)
const final {
124 BSONObjBuilder* output) {
129 BSONObjBuilder* result,
130 double scale)
const {
139 BSONObjBuilder* extraInfo = NULL,
140 int infoLevel = 0)
const {
156 virtual const char*
name()
const {
177 boost::shared_array<char>
data;
182 typedef std::map<RecordId, HeapRecordStoreBtree::MmapV1RecordHeader>
Records;
203 change->
commit(boost::none);
232 boost::shared_array<char>
old;
void notifyInsert(HeapRecordStoreBtree *rs, const RecordId &loc)
Definition: heap_record_store_btree.cpp:142
Definition: heap_record_store_btree.h:223
RecordId allocateLoc()
Definition: heap_record_store_btree.cpp:103
ValidateCmdLevel
Definition: record_store.h:93
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 th...
Definition: heap_record_store_btree.h:144
Definition: record_store.h:673
virtual bool compactSupported() const
does this RecordStore support the compact operation?
Definition: heap_record_store_btree.h:116
virtual void registerChange(Change *change)
The RecoveryUnit takes ownership of the change.
Definition: heap_record_store_btree.h:202
virtual StatusWith< RecordData > updateWithDamages(OperationContext *opCtx, const RecordId &loc, const RecordData &oldRec, const char *damageSource, const mutablebson::DamageVector &damages)
Updates the record positioned at 'loc' in-place using the deltas described by 'damages'.
Definition: heap_record_store_btree.h:94
HeapRecordStoreBtree(StringData ns)
Definition: heap_record_store_btree.h:54
virtual void setOrderedCommit(bool orderedCommit)
Definition: heap_record_store_btree.h:215
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
void * data
Definition: heap_record_store_btree.h:230
virtual SnapshotId getSnapshotId() const
Gets the local SnapshotId.
Definition: heap_record_store_btree.h:211
size_t len
Definition: heap_record_store_btree.h:231
void commitUnitOfWork() final
Marks the end of a unit of work and commits all changes registered by calls to onCommit or registerCh...
Definition: heap_record_store_btree.cpp:120
A replacement for the Record class.
Definition: record_data.h:43
virtual RecordData dataFor(OperationContext *opCtx, const RecordId &loc) const
Get the RecordData at loc, which must exist.
Definition: heap_record_store_btree.cpp:45
virtual MmapV1RecordHeader * recordFor(const RecordId &loc) const
Definition: heap_record_store_btree.h:148
This is so when a RecordStore is validating all records it can call back to someone to check if a rec...
Definition: record_store.h:687
Definition: record_store.h:78
Definition: heap_record_store_btree.h:229
bool inclusive
Definition: btree_interface.cpp:335
RecordId loc
Definition: heap_record_store_btree.h:225
Allows inserting a Record "in-place" without creating a copy ahead of time.
Definition: record_store.h:62
std::shared_ptr< void > data
Definition: ephemeral_for_test_record_store_test.cpp:74
virtual const char * name() const
Definition: heap_record_store_btree.h:156
std::unique_ptr< RecordStore > rs
Definition: kv_engine_test_timestamps.cpp:207
virtual void * writingPtr(void *data, size_t len)
Declare that the data at [x, x + len) is being written.
Definition: heap_record_store_btree.cpp:135
OperationContext Database StringData CollectionOptions bool const BSONObj &idIndex Status
Definition: database_impl.cpp:955
virtual void setRollbackWritesDisabled()
Sets a flag that declares this RecoveryUnit will skip rolling back writes, for the duration of the cu...
Definition: heap_record_store_btree.h:209
HeapRecordStoreBtree * rs
Definition: heap_record_store_btree.h:224
virtual void abandonSnapshot()
If there is an open transaction, it is closed.
Definition: heap_record_store_btree.h:200
A RecoveryUnit for HeapRecordStoreBtree, this is for testing btree only.
Definition: heap_record_store_btree.h:190
A RecordStore that stores all data on the heap.
Definition: heap_record_store_btree.h:45
Definition: index_key_validate.h:40
virtual void commit(boost::optional< Timestamp > commitTime)=0
A RecoveryUnit is responsible for ensuring that data is persisted.
Definition: recovery_unit.h:51
const std::string & getIdent() const override
Definition: heap_record_store_btree.h:49
void abortUnitOfWork() final
Marks the end of a unit of work and rolls back all changes registered by calls to onRollback or regis...
Definition: heap_record_store_btree.cpp:125
virtual bool findRecord(OperationContext *opCtx, const RecordId &loc, RecordData *out) const
Definition: heap_record_store_btree.cpp:53
std::vector< ModEntry > _mods
Definition: heap_record_store_btree.h:234
An abstraction used for storing documents in a collection or entries in an index.
Definition: record_store.h:282
virtual Status insertRecordsWithDocWriter(OperationContext *opCtx, const DocWriter *const *docs, const Timestamp *, size_t nDocs, RecordId *idsOut)
Inserts nDocs documents into this RecordStore using the DocWriter interface.
Definition: heap_record_store_btree.cpp:81
virtual const std::string & ns() const
Definition: record_store.h:295
virtual Status truncate(OperationContext *opCtx)
removes all Records
Definition: heap_record_store_btree.h:108
virtual void updateStatsAfterRepair(OperationContext *opCtx, long long numRecords, long long dataSize)
Called after a repair operation is run with the recomputed numRecords and dataSize.
Definition: heap_record_store_btree.h:164
virtual Status validate(OperationContext *opCtx, ValidateCmdLevel level, ValidateAdaptor *adaptor, ValidateResults *results, BSONObjBuilder *output)
Definition: heap_record_store_btree.h:120
virtual bool waitUntilDurable()
Waits until all commits that happened before this call are durable in the journal.
Definition: heap_record_store_btree.h:196
std::unique_ptr< SeekableRecordCursor > getCursor(OperationContext *opCtx, bool forward) const final
Returns a new cursor over this record store.
Definition: heap_record_store_btree.h:102
std::map< RecordId, HeapRecordStoreBtree::MmapV1RecordHeader > Records
Definition: heap_record_store_btree.h:182
virtual void increaseStorageSize(OperationContext *opCtx, int size, bool enforceQuota)
Definition: heap_record_store_btree.h:134
A Change is an action that is registerChange()'d while a WriteUnitOfWork exists.
Definition: recovery_unit.h:295
virtual void appendCustomStats(OperationContext *opCtx, BSONObjBuilder *result, double scale) const
Definition: heap_record_store_btree.h:128
virtual void deleteRecord(OperationContext *opCtx, const RecordId &dl)
Definition: heap_record_store_btree.cpp:64
virtual int64_t storageSize(OperationContext *opCtx, BSONObjBuilder *extraInfo=NULL, int infoLevel=0) const
Definition: heap_record_store_btree.h:138
Records _records
Definition: heap_record_store_btree.h:183
Definition: snapshot.h:37
virtual bool isCapped() const
Definition: heap_record_store_btree.h:152
virtual Status touch(OperationContext *opCtx, BSONObjBuilder *output) const
Load all data into cache.
Definition: heap_record_store_btree.cpp:113
virtual bool updateWithDamagesSupported() const
Definition: heap_record_store_btree.h:90
void waitForAllEarlierOplogWritesToBeVisible(OperationContext *opCtx) const override
Waits for all writes that completed before this call to be visible to forward scans.
Definition: heap_record_store_btree.h:160
int64_t _nextId
Definition: heap_record_store_btree.h:184
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
boost::shared_array< char > old
Definition: heap_record_store_btree.h:232
virtual Status updateRecord(OperationContext *opCtx, const RecordId &oldLocation, const char *data, int len, bool enforceQuota, UpdateNotifier *notifier)
Definition: heap_record_store_btree.h:81
std::vector< InsertEntry > _insertions
Definition: heap_record_store_btree.h:227
virtual void cappedTruncateAfter(OperationContext *opCtx, RecordId end, bool inclusive)
Truncate documents newer than the document at 'end' from the capped collection.
Definition: heap_record_store_btree.h:112
virtual long long numRecords(OperationContext *opCtx) const
Total number of record in the RecordStore.
Definition: heap_record_store_btree.h:71
virtual StatusWith< RecordId > insertRecord(OperationContext *opCtx, const char *data, int len, Timestamp, bool enforceQuota)
Definition: heap_record_store_btree.cpp:68
void beginUnitOfWork(OperationContext *opCtx) final
Marks the beginning of a unit of work.
Definition: heap_record_store_btree.h:192