Storage Engine API
mongo::MobileIndexUnique Class Referencefinal

#include <mobile_index.h>

Inheritance diagram for mongo::MobileIndexUnique:
mongo::MobileIndex mongo::SortedDataInterface

Public Member Functions

 MobileIndexUnique (OperationContext *opCtx, const IndexDescriptor *desc, const std::string &ident)
 
 MobileIndexUnique (const Ordering &ordering, const std::string &ident)
 
SortedDataBuilderInterfacegetBulkBuilder (OperationContext *opCtx, bool dupsAllowed) override
 Return a bulk builder for 'this' index. More...
 
std::unique_ptr< SortedDataInterface::CursornewCursor (OperationContext *opCtx, bool isForward) const override
 Returns an unpositioned cursor over 'this' index. More...
 
- Public Member Functions inherited from mongo::MobileIndex
 MobileIndex (OperationContext *opCtx, const IndexDescriptor *desc, const std::string &ident)
 
 MobileIndex (bool isUnique, const Ordering &ordering, const std::string &ident)
 
virtual ~MobileIndex ()
 
Status insert (OperationContext *opCtx, const BSONObj &key, const RecordId &recId, bool dupsAllowed) override
 Insert an entry into the index with the specified key and RecordId. More...
 
void unindex (OperationContext *opCtx, const BSONObj &key, const RecordId &recId, bool dupsAllowed) override
 Remove the entry from the index with the specified key and RecordId. More...
 
void fullValidate (OperationContext *opCtx, long long *numKeysOut, ValidateResults *fullResults) const override
 Note: this validates the entire database file, not just the table used by this index. More...
 
bool appendCustomStats (OperationContext *opCtx, BSONObjBuilder *output, double scale) const override
 
long long getSpaceUsedBytes (OperationContext *opCtx) const override
 Return the number of bytes consumed by 'this' index. More...
 
long long numEntries (OperationContext *opCtx) const override
 Return the number of entries in 'this' index. More...
 
bool isEmpty (OperationContext *opCtx) override
 Return true if 'this' index is empty, and false otherwise. More...
 
Status initAsEmpty (OperationContext *opCtx) override
 
Status dupKeyCheck (OperationContext *opCtx, const BSONObj &key, const RecordId &recId) override
 Return ErrorCodes::DuplicateKey if 'key' already exists in 'this' index at a RecordId other than 'loc', and Status::OK() otherwise. More...
 
template<typename ValueType >
Status doInsert (OperationContext *opCtx, const KeyString &key, const ValueType &value, bool isTransactional=true)
 Performs the insert into the table with the given key and value. More...
 
Ordering getOrdering () const
 
KeyString::Version getKeyStringVersion () const
 
bool isUnique ()
 
std::string getIdent () const
 
- Public Member Functions inherited from mongo::SortedDataInterface
virtual ~SortedDataInterface ()
 
virtual Status compact (OperationContext *opCtx)
 Attempt to reduce the storage space used by this index via compaction. More...
 
virtual Status touch (OperationContext *opCtx) const
 Attempt to bring the entirety of 'this' index into memory. More...
 
virtual std::unique_ptr< CursornewRandomCursor (OperationContext *opCtx) const
 Constructs a cursor over an index that returns entries in a randomized order, and allows storage engines to provide a more efficient way to randomly sample a collection than MongoDB's default sampling methods, which are used when this method returns {}. More...
 

Protected Member Functions

Status _insert (OperationContext *opCtx, const BSONObj &key, const RecordId &recId, bool dupsAllowed) override
 
void _unindex (OperationContext *opCtx, const BSONObj &key, const RecordId &recId, bool dupsAllowed) override
 
- Protected Member Functions inherited from mongo::MobileIndex
bool _isDup (OperationContext *opCtx, const BSONObj &key, RecordId recId)
 
Status _dupKeyError (const BSONObj &key)
 
void _doDelete (OperationContext *opCtx, const KeyString &key, KeyString *value=nullptr)
 Performs the deletion from the table matching the given key. More...
 

Protected Attributes

const bool _isPartial = false
 
- Protected Attributes inherited from mongo::MobileIndex
const bool _isUnique
 
const Ordering _ordering
 
const KeyString::Version _keyStringVersion = KeyString::kLatestVersion
 
const std::string _ident
 

Additional Inherited Members

- Static Public Member Functions inherited from mongo::MobileIndex
static Status create (OperationContext *opCtx, const std::string &ident)
 Creates a SQLite table suitable for a new Mobile index. More...
 
- Static Protected Member Functions inherited from mongo::MobileIndex
static Status _checkKeySize (const BSONObj &key)
 Checks if key size is too long. More...
 

Constructor & Destructor Documentation

◆ MobileIndexUnique() [1/2]

mongo::MobileIndexUnique::MobileIndexUnique ( OperationContext *  opCtx,
const IndexDescriptor *  desc,
const std::string &  ident 
)

◆ MobileIndexUnique() [2/2]

mongo::MobileIndexUnique::MobileIndexUnique ( const Ordering &  ordering,
const std::string &  ident 
)

Member Function Documentation

◆ _insert()

Status mongo::MobileIndexUnique::_insert ( OperationContext *  opCtx,
const BSONObj &  key,
const RecordId &  recId,
bool  dupsAllowed 
)
overrideprotectedvirtual

Implements mongo::MobileIndex.

◆ _unindex()

void mongo::MobileIndexUnique::_unindex ( OperationContext *  opCtx,
const BSONObj &  key,
const RecordId &  recId,
bool  dupsAllowed 
)
overrideprotectedvirtual

Implements mongo::MobileIndex.

◆ getBulkBuilder()

SortedDataBuilderInterface * mongo::MobileIndexUnique::getBulkBuilder ( OperationContext *  opCtx,
bool  dupsAllowed 
)
overridevirtual

Return a bulk builder for 'this' index.

Implementations can assume that 'this' index outlives its bulk builder.

Parameters
opCtxthe transaction under which keys are added to 'this' index
dupsAllowedtrue if duplicate keys are allowed, and false otherwise
Returns
caller takes ownership

Implements mongo::SortedDataInterface.

◆ newCursor()

std::unique_ptr< SortedDataInterface::Cursor > mongo::MobileIndexUnique::newCursor ( OperationContext *  opCtx,
bool  isForward 
) const
overridevirtual

Returns an unpositioned cursor over 'this' index.

Implementations can assume that 'this' index outlives all cursors it produces.

Implements mongo::SortedDataInterface.

Member Data Documentation

◆ _isPartial

const bool mongo::MobileIndexUnique::_isPartial = false
protected

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