33 #include "mongo/base/string_data.h" 34 #include "mongo/bson/bsonobj.h" 36 #include "mongo/db/server_options.h" 41 class NamespaceDetails;
43 class MMAPV1DatabaseCatalogEntry;
46 class OperationContext;
53 RecordId namespacesRecordId,
67 void getAllIndexes(OperationContext* opCtx, std::vector<std::string>* names)
const final;
69 void getReadyIndexes(OperationContext* opCtx, std::vector<std::string>* names)
const final;
71 BSONObj
getIndexSpec(OperationContext* opCtx, StringData idxName)
const final;
75 MultikeyPaths* multikeyPaths)
const final;
81 const MultikeyPaths& multikeyPaths)
final;
83 RecordId
getIndexHead(OperationContext* opCtx, StringData indexName)
const final;
85 void setIndexHead(OperationContext* opCtx, StringData indexName,
const RecordId& newHead)
final;
87 bool isIndexReady(OperationContext* opCtx, StringData indexName)
const final;
94 const IndexDescriptor* spec,
95 bool isBackgroundSecondaryBuild)
final;
101 long long newExpireSeconds)
final;
103 void updateFlags(OperationContext* opCtx,
int newValue)
final;
110 const BSONObj& validator,
111 StringData validationLevel,
112 StringData validationAction)
final;
114 void setIsTemp(OperationContext* opCtx,
bool isTemp)
final;
void updateValidator(OperationContext *opCtx, const BSONObj &validator, StringData validationLevel, StringData validationAction) final
Updates the validator for this collection.
Definition: namespace_details_collection_entry.cpp:469
void updateCappedSize(OperationContext *opCtx, long long size) final
Updates size of a capped Collection.
Definition: namespace_details_collection_entry.cpp:505
RecordStore * _namespacesRecordStore
Definition: namespace_details_collection_entry.h:133
Collection *const OperationContext *const const StringData OptionalCollectionUUID CollectionCatalogEntry *const details
Definition: collection_impl.cpp:80
Definition: collection_options.h:57
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
NamespaceDetailsCollectionCatalogEntry(StringData ns, NamespaceDetails *details, RecordStore *namespacesRecordStore, RecordId namespacesRecordId, RecordStore *indexRecordStore, MMAPV1DatabaseCatalogEntry *db)
Definition: namespace_details_collection_entry.cpp:53
Definition: collection_catalog_entry.h:47
OperationContext Database StringData BSONObj CollectionOptions::ParseKind bool const BSONObj &idIndex Status
Definition: database_impl.cpp:956
bool isIndexReady(OperationContext *opCtx, StringData indexName) const final
Definition: namespace_details_collection_entry.cpp:196
int _findIndexNumber(OperationContext *opCtx, StringData indexName) const
Definition: namespace_details_collection_entry.cpp:208
void setIsTemp(OperationContext *opCtx, bool isTemp) final
Updates the 'temp' setting for this collection.
Definition: namespace_details_collection_entry.cpp:481
int getTotalIndexCount(OperationContext *opCtx) const final
Definition: namespace_details_collection_entry.cpp:88
void getReadyIndexes(OperationContext *opCtx, std::vector< std::string > *names) const final
Definition: namespace_details_collection_entry.cpp:110
void addUUID(OperationContext *opCtx, CollectionUUID uuid, Collection *coll) final
Assigns a new UUID to this collection.
Definition: namespace_details_collection_entry.cpp:431
void setIndexHead(OperationContext *opCtx, StringData indexName, const RecordId &newHead) final
Definition: namespace_details_collection_entry.cpp:188
MMAPV1DatabaseCatalogEntry * _db
Definition: namespace_details_collection_entry.h:139
CollectionOptions getCollectionOptions(OperationContext *opCtx) const final
Definition: namespace_details_collection_entry.cpp:68
Definition: namespace_details_collection_entry.h:48
UUID CollectionUUID
A CollectionUUID is a 128-bit unique identifier, per RFC 4122, v4.
Definition: collection_options.h:53
NamespaceDetails * _details
Definition: namespace_details_collection_entry.h:132
void updateTTLSetting(OperationContext *opCtx, StringData idxName, long long newExpireSeconds) final
Definition: namespace_details_collection_entry.cpp:361
this is NOT safe through a yield right now.
Definition: collection.h:160
Definition: namespace_details.h:47
void updateFlags(OperationContext *opCtx, int newValue) final
Sets the flags field of CollectionOptions to newValue.
Definition: namespace_details_collection_entry.cpp:425
Status prepareForIndexBuild(OperationContext *opCtx, const IndexDescriptor *spec, bool isBackgroundSecondaryBuild) final
Definition: namespace_details_collection_entry.cpp:292
boost::optional< CollectionUUID > OptionalCollectionUUID
Definition: collection_options.h:55
RecordId getNamespacesRecordId()
Definition: namespace_details_collection_entry.h:122
KVPrefix getIndexPrefix(OperationContext *opCtx, StringData indexName) const final
Definition: namespace_details_collection_entry.cpp:203
Collection *const OperationContext *const const StringData OptionalCollectionUUID uuid
Definition: collection_impl.cpp:80
void setNamespacesRecordId(OperationContext *opCtx, RecordId newId)
'opCtx' is only allowed to be null when called from the constructor.
Definition: namespace_details_collection_entry.cpp:486
int getMaxAllowedIndexes() const final
Definition: namespace_details_collection_entry.cpp:96
void getAllIndexes(OperationContext *opCtx, std::vector< std::string > *names) const final
Definition: namespace_details_collection_entry.cpp:100
bool isEqualToMetadataUUID(OperationContext *opCtx, OptionalCollectionUUID uuid)
Compare the UUID argument to the UUID obtained from the metadata.
Definition: namespace_details_collection_entry.cpp:452
An abstraction used for storing documents in a collection or entries in an index. ...
Definition: record_store.h:282
int getCompletedIndexCount(OperationContext *opCtx) const final
Definition: namespace_details_collection_entry.cpp:92
void _updateSystemNamespaces(OperationContext *opCtx, const BSONObj &update)
Updates the entry for this namespace in '_namespacesRecordStore', updating '_namespacesRecordId' if n...
Definition: namespace_details_collection_entry.cpp:396
OperationContext Database * db
Definition: database_impl.cpp:949
bool isIndexMultikey(OperationContext *opCtx, StringData indexName, MultikeyPaths *multikeyPaths) const final
Returns true if the index identified by 'indexName' is multikey, and returns false otherwise...
Definition: namespace_details_collection_entry.cpp:123
void indexBuildSuccess(OperationContext *opCtx, StringData indexName) final
Definition: namespace_details_collection_entry.cpp:330
~NamespaceDetailsCollectionCatalogEntry()
Definition: namespace_details_collection_entry.h:57
A KVPrefix may be prepended to the keys of entries in an underlying KV store.
Definition: kv_prefix.h:44
RecordId _namespacesRecordId
Definition: namespace_details_collection_entry.h:136
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
RecordId getIndexHead(OperationContext *opCtx, StringData indexName) const final
Definition: namespace_details_collection_entry.cpp:173
Definition: mmap_v1_database_catalog_entry.h:54
BSONObj getIndexSpec(OperationContext *opCtx, StringData idxName) const final
Definition: namespace_details_collection_entry.cpp:180
RecordStore * _indexRecordStore
Definition: namespace_details_collection_entry.h:138
const NamespaceString & ns() const
Definition: collection_catalog_entry.h:52
bool setIndexIsMultikey(OperationContext *opCtx, int idxNo, bool multikey=true)
Definition: namespace_details_collection_entry.cpp:147
Status removeIndex(OperationContext *opCtx, StringData indexName) final
Definition: namespace_details_collection_entry.cpp:243