Storage Engine API
mongo::NamespaceDetailsCollectionCatalogEntry Class Reference

#include <namespace_details_collection_entry.h>

Inheritance diagram for mongo::NamespaceDetailsCollectionCatalogEntry:
mongo::CollectionCatalogEntry

Public Member Functions

 NamespaceDetailsCollectionCatalogEntry (StringData ns, NamespaceDetails *details, RecordStore *namespacesRecordStore, RecordId namespacesRecordId, RecordStore *indexRecordStore, MMAPV1DatabaseCatalogEntry *db)
 
 ~NamespaceDetailsCollectionCatalogEntry ()
 
CollectionOptions getCollectionOptions (OperationContext *opCtx) const final
 
int getTotalIndexCount (OperationContext *opCtx) const final
 
int getCompletedIndexCount (OperationContext *opCtx) const final
 
int getMaxAllowedIndexes () const final
 
void getAllIndexes (OperationContext *opCtx, std::vector< std::string > *names) const final
 
void getReadyIndexes (OperationContext *opCtx, std::vector< std::string > *names) const final
 
BSONObj getIndexSpec (OperationContext *opCtx, StringData idxName) const final
 
bool isIndexMultikey (OperationContext *opCtx, StringData indexName, MultikeyPaths *multikeyPaths) const final
 Returns true if the index identified by 'indexName' is multikey, and returns false otherwise. More...
 
bool isIndexMultikey (int idxNo) const
 
bool setIndexIsMultikey (OperationContext *opCtx, int idxNo, bool multikey=true)
 
bool setIndexIsMultikey (OperationContext *opCtx, StringData indexName, const MultikeyPaths &multikeyPaths) final
 Sets the index identified by 'indexName' to be multikey. More...
 
RecordId getIndexHead (OperationContext *opCtx, StringData indexName) const final
 
void setIndexHead (OperationContext *opCtx, StringData indexName, const RecordId &newHead) final
 
bool isIndexReady (OperationContext *opCtx, StringData indexName) const final
 
KVPrefix getIndexPrefix (OperationContext *opCtx, StringData indexName) const final
 
Status removeIndex (OperationContext *opCtx, StringData indexName) final
 
Status prepareForIndexBuild (OperationContext *opCtx, const IndexDescriptor *spec, bool isBackgroundSecondaryBuild) final
 
void indexBuildSuccess (OperationContext *opCtx, StringData indexName) final
 
void updateTTLSetting (OperationContext *opCtx, StringData idxName, long long newExpireSeconds) final
 
void updateFlags (OperationContext *opCtx, int newValue) final
 Sets the flags field of CollectionOptions to newValue. More...
 
void addUUID (OperationContext *opCtx, CollectionUUID uuid, Collection *coll) final
 Assigns a new UUID to this collection. More...
 
bool isEqualToMetadataUUID (OperationContext *opCtx, OptionalCollectionUUID uuid)
 Compare the UUID argument to the UUID obtained from the metadata. More...
 
void updateValidator (OperationContext *opCtx, const BSONObj &validator, StringData validationLevel, StringData validationAction) final
 Updates the validator for this collection. More...
 
void setIsTemp (OperationContext *opCtx, bool isTemp) final
 Updates the 'temp' setting for this collection. More...
 
void updateCappedSize (OperationContext *opCtx, long long size) final
 Updates size of a capped Collection. More...
 
int _findIndexNumber (OperationContext *opCtx, StringData indexName) const
 
RecordId getNamespacesRecordId ()
 
void setNamespacesRecordId (OperationContext *opCtx, RecordId newId)
 'opCtx' is only allowed to be null when called from the constructor. More...
 
- Public Member Functions inherited from mongo::CollectionCatalogEntry
 CollectionCatalogEntry (StringData ns)
 
virtual ~CollectionCatalogEntry ()
 
const NamespaceString & ns () const
 
virtual void getAllUniqueIndexes (OperationContext *opCtx, std::vector< std::string > *names) const
 
virtual void updateIndexMetadata (OperationContext *opCtx, const IndexDescriptor *desc)
 

Private Member Functions

void _updateSystemNamespaces (OperationContext *opCtx, const BSONObj &update)
 Updates the entry for this namespace in '_namespacesRecordStore', updating '_namespacesRecordId' if necessary. More...
 

Private Attributes

NamespaceDetails_details
 
RecordStore_namespacesRecordStore
 
RecordId _namespacesRecordId
 
RecordStore_indexRecordStore
 
MMAPV1DatabaseCatalogEntry_db
 

Friends

class MMAPV1DatabaseCatalogEntry
 

Constructor & Destructor Documentation

◆ NamespaceDetailsCollectionCatalogEntry()

mongo::NamespaceDetailsCollectionCatalogEntry::NamespaceDetailsCollectionCatalogEntry ( StringData  ns,
NamespaceDetails details,
RecordStore namespacesRecordStore,
RecordId  namespacesRecordId,
RecordStore indexRecordStore,
MMAPV1DatabaseCatalogEntry db 
)

◆ ~NamespaceDetailsCollectionCatalogEntry()

mongo::NamespaceDetailsCollectionCatalogEntry::~NamespaceDetailsCollectionCatalogEntry ( )
inline

Member Function Documentation

◆ _findIndexNumber()

int mongo::NamespaceDetailsCollectionCatalogEntry::_findIndexNumber ( OperationContext *  opCtx,
StringData  indexName 
) const

◆ _updateSystemNamespaces()

void mongo::NamespaceDetailsCollectionCatalogEntry::_updateSystemNamespaces ( OperationContext *  opCtx,
const BSONObj &  update 
)
private

Updates the entry for this namespace in '_namespacesRecordStore', updating '_namespacesRecordId' if necessary.

◆ addUUID()

void mongo::NamespaceDetailsCollectionCatalogEntry::addUUID ( OperationContext *  opCtx,
CollectionUUID  uuid,
Collection coll 
)
finalvirtual

Assigns a new UUID to this collection.

All collections must have UUIDs, so this is called if a collection erroneously does not have a UUID.

Implements mongo::CollectionCatalogEntry.

◆ getAllIndexes()

void mongo::NamespaceDetailsCollectionCatalogEntry::getAllIndexes ( OperationContext *  opCtx,
std::vector< std::string > *  names 
) const
finalvirtual

◆ getCollectionOptions()

CollectionOptions mongo::NamespaceDetailsCollectionCatalogEntry::getCollectionOptions ( OperationContext *  opCtx) const
finalvirtual

◆ getCompletedIndexCount()

int mongo::NamespaceDetailsCollectionCatalogEntry::getCompletedIndexCount ( OperationContext *  opCtx) const
finalvirtual

◆ getIndexHead()

RecordId mongo::NamespaceDetailsCollectionCatalogEntry::getIndexHead ( OperationContext *  opCtx,
StringData  indexName 
) const
finalvirtual

◆ getIndexPrefix()

KVPrefix mongo::NamespaceDetailsCollectionCatalogEntry::getIndexPrefix ( OperationContext *  opCtx,
StringData  indexName 
) const
finalvirtual

◆ getIndexSpec()

BSONObj mongo::NamespaceDetailsCollectionCatalogEntry::getIndexSpec ( OperationContext *  opCtx,
StringData  idxName 
) const
finalvirtual

◆ getMaxAllowedIndexes()

int mongo::NamespaceDetailsCollectionCatalogEntry::getMaxAllowedIndexes ( ) const
finalvirtual

◆ getNamespacesRecordId()

RecordId mongo::NamespaceDetailsCollectionCatalogEntry::getNamespacesRecordId ( )
inline

◆ getReadyIndexes()

void mongo::NamespaceDetailsCollectionCatalogEntry::getReadyIndexes ( OperationContext *  opCtx,
std::vector< std::string > *  names 
) const
finalvirtual

◆ getTotalIndexCount()

int mongo::NamespaceDetailsCollectionCatalogEntry::getTotalIndexCount ( OperationContext *  opCtx) const
finalvirtual

◆ indexBuildSuccess()

void mongo::NamespaceDetailsCollectionCatalogEntry::indexBuildSuccess ( OperationContext *  opCtx,
StringData  indexName 
)
finalvirtual

◆ isEqualToMetadataUUID()

bool mongo::NamespaceDetailsCollectionCatalogEntry::isEqualToMetadataUUID ( OperationContext *  opCtx,
OptionalCollectionUUID  uuid 
)
virtual

Compare the UUID argument to the UUID obtained from the metadata.

Return true if they are equal, false otherwise. uuid can become a CollectionUUID once MMAPv1 is removed.

Implements mongo::CollectionCatalogEntry.

◆ isIndexMultikey() [1/2]

bool mongo::NamespaceDetailsCollectionCatalogEntry::isIndexMultikey ( OperationContext *  opCtx,
StringData  indexName,
MultikeyPaths *  multikeyPaths 
) const
finalvirtual

Returns true if the index identified by 'indexName' is multikey, and returns false otherwise.

If the 'multikeyPaths' pointer is non-null, then it must point to an empty vector. If this index supports tracking path-level multikey information, then this function sets 'multikeyPaths' as the path components that cause this index to be multikey.

In particular, if this function returns false and the index supports tracking path-level multikey information, then 'multikeyPaths' is initialized as a vector with size equal to the number of elements in the index key pattern of empty sets.

Implements mongo::CollectionCatalogEntry.

◆ isIndexMultikey() [2/2]

bool mongo::NamespaceDetailsCollectionCatalogEntry::isIndexMultikey ( int  idxNo) const

◆ isIndexReady()

bool mongo::NamespaceDetailsCollectionCatalogEntry::isIndexReady ( OperationContext *  opCtx,
StringData  indexName 
) const
finalvirtual

◆ prepareForIndexBuild()

Status mongo::NamespaceDetailsCollectionCatalogEntry::prepareForIndexBuild ( OperationContext *  opCtx,
const IndexDescriptor *  spec,
bool  isBackgroundSecondaryBuild 
)
finalvirtual

◆ removeIndex()

Status mongo::NamespaceDetailsCollectionCatalogEntry::removeIndex ( OperationContext *  opCtx,
StringData  indexName 
)
finalvirtual

◆ setIndexHead()

void mongo::NamespaceDetailsCollectionCatalogEntry::setIndexHead ( OperationContext *  opCtx,
StringData  indexName,
const RecordId &  newHead 
)
finalvirtual

◆ setIndexIsMultikey() [1/2]

bool mongo::NamespaceDetailsCollectionCatalogEntry::setIndexIsMultikey ( OperationContext *  opCtx,
int  idxNo,
bool  multikey = true 
)

◆ setIndexIsMultikey() [2/2]

bool mongo::NamespaceDetailsCollectionCatalogEntry::setIndexIsMultikey ( OperationContext *  opCtx,
StringData  indexName,
const MultikeyPaths &  multikeyPaths 
)
finalvirtual

Sets the index identified by 'indexName' to be multikey.

If 'multikeyPaths' is non-empty, then it must be a vector with size equal to the number of elements in the index key pattern. Additionally, at least one path component of the indexed fields must cause this index to be multikey.

This function returns true if the index metadata has changed, and returns false otherwise.

Implements mongo::CollectionCatalogEntry.

◆ setIsTemp()

void mongo::NamespaceDetailsCollectionCatalogEntry::setIsTemp ( OperationContext *  opCtx,
bool  isTemp 
)
finalvirtual

Updates the 'temp' setting for this collection.

Implements mongo::CollectionCatalogEntry.

◆ setNamespacesRecordId()

void mongo::NamespaceDetailsCollectionCatalogEntry::setNamespacesRecordId ( OperationContext *  opCtx,
RecordId  newId 
)

'opCtx' is only allowed to be null when called from the constructor.

◆ updateCappedSize()

void mongo::NamespaceDetailsCollectionCatalogEntry::updateCappedSize ( OperationContext *  opCtx,
long long  size 
)
finalvirtual

Updates size of a capped Collection.

Implements mongo::CollectionCatalogEntry.

◆ updateFlags()

void mongo::NamespaceDetailsCollectionCatalogEntry::updateFlags ( OperationContext *  opCtx,
int  newValue 
)
finalvirtual

Sets the flags field of CollectionOptions to newValue.

Subsequent calls to getCollectionOptions should have flags==newValue and flagsSet==true.

Implements mongo::CollectionCatalogEntry.

◆ updateTTLSetting()

void mongo::NamespaceDetailsCollectionCatalogEntry::updateTTLSetting ( OperationContext *  opCtx,
StringData  idxName,
long long  newExpireSeconds 
)
finalvirtual

◆ updateValidator()

void mongo::NamespaceDetailsCollectionCatalogEntry::updateValidator ( OperationContext *  opCtx,
const BSONObj &  validator,
StringData  validationLevel,
StringData  validationAction 
)
finalvirtual

Updates the validator for this collection.

An empty validator removes all validation.

Implements mongo::CollectionCatalogEntry.

Friends And Related Function Documentation

◆ MMAPV1DatabaseCatalogEntry

friend class MMAPV1DatabaseCatalogEntry
friend

Member Data Documentation

◆ _db

MMAPV1DatabaseCatalogEntry* mongo::NamespaceDetailsCollectionCatalogEntry::_db
private

◆ _details

NamespaceDetails* mongo::NamespaceDetailsCollectionCatalogEntry::_details
private

◆ _indexRecordStore

RecordStore* mongo::NamespaceDetailsCollectionCatalogEntry::_indexRecordStore
private

◆ _namespacesRecordId

RecordId mongo::NamespaceDetailsCollectionCatalogEntry::_namespacesRecordId
private

◆ _namespacesRecordStore

RecordStore* mongo::NamespaceDetailsCollectionCatalogEntry::_namespacesRecordStore
private

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