#include <uuid_catalog.h>
|
| UUIDCatalog ()=default |
|
void | onCreateCollection (OperationContext *opCtx, Collection *coll, CollectionUUID uuid) |
| This function inserts the entry for uuid, coll into the UUID Collection. More...
|
|
void | onDropCollection (OperationContext *opCtx, CollectionUUID uuid) |
| This function removes the entry for uuid from the UUID catalog. More...
|
|
void | onRenameCollection (OperationContext *opCtx, Collection *coll, CollectionUUID uuid) |
| This function atomically removes any existing entry for uuid from the UUID catalog and adds a new entry for uuid associated with the Collection coll. More...
|
|
void | onCloseDatabase (Database *db) |
| Implies onDropCollection for all collections in db, but is not transactional. More...
|
|
Collection * | replaceUUIDCatalogEntry (CollectionUUID uuid, Collection *coll) |
|
void | registerUUIDCatalogEntry (CollectionUUID uuid, Collection *coll) |
|
Collection * | removeUUIDCatalogEntry (CollectionUUID uuid) |
|
Collection * | lookupCollectionByUUID (CollectionUUID uuid) const |
| This function gets the Collection* pointer that corresponds to CollectionUUID uuid. More...
|
|
NamespaceString | lookupNSSByUUID (CollectionUUID uuid) const |
| This function gets the NamespaceString from the Collection* pointer that corresponds to CollectionUUID uuid. More...
|
|
void | onCloseCatalog () |
| Puts the catalog in closed state. More...
|
|
void | onOpenCatalog () |
| Puts the catatlog back in open state, removing the pre-close state. More...
|
|
boost::optional< CollectionUUID > | prev (const StringData &db, CollectionUUID uuid) |
| Return the UUID lexicographically preceding uuid in the database named by db . More...
|
|
boost::optional< CollectionUUID > | next (const StringData &db, CollectionUUID uuid) |
| Return the UUID lexicographically following uuid in the database named by db . More...
|
|
◆ UUIDCatalog()
mongo::UUIDCatalog::UUIDCatalog |
( |
| ) |
|
|
default |
◆ _getOrdering_inlock()
const std::vector< CollectionUUID > & mongo::UUIDCatalog::_getOrdering_inlock |
( |
const StringData & |
db, |
|
|
const stdx::lock_guard< stdx::mutex > & |
|
|
) |
| |
|
private |
◆ get() [1/2]
UUIDCatalog & mongo::UUIDCatalog::get |
( |
ServiceContext * |
svcCtx | ) |
|
|
static |
◆ get() [2/2]
UUIDCatalog & mongo::UUIDCatalog::get |
( |
OperationContext * |
opCtx | ) |
|
|
static |
◆ lookupCollectionByUUID()
This function gets the Collection* pointer that corresponds to CollectionUUID uuid.
The required locks should be obtained prior to calling this function, or else the found Collection pointer might no longer be valid when the call returns.
◆ lookupNSSByUUID()
NamespaceString mongo::UUIDCatalog::lookupNSSByUUID |
( |
CollectionUUID |
uuid | ) |
const |
This function gets the NamespaceString from the Collection* pointer that corresponds to CollectionUUID uuid.
If there is no such pointer, an empty NamespaceString is returned. See onCloseCatalog/onOpenCatalog for more info.
◆ MONGO_DISALLOW_COPYING()
mongo::UUIDCatalog::MONGO_DISALLOW_COPYING |
( |
UUIDCatalog |
| ) |
|
|
private |
◆ next()
Return the UUID lexicographically following uuid
in the database named by db
.
Return boost::none
if uuid
is not found, or is the last UUID in that database.
◆ onCloseCatalog()
void mongo::UUIDCatalog::onCloseCatalog |
( |
| ) |
|
Puts the catalog in closed state.
In this state, the lookupNSSByUUID method will fall back to the pre-close state to resolve queries for currently unknown UUIDs. This allows authorization, which needs to do lookups outside of database locks, to proceed.
◆ onCloseDatabase()
Implies onDropCollection for all collections in db, but is not transactional.
◆ onCreateCollection()
This function inserts the entry for uuid, coll into the UUID Collection.
It is called by the op observer when a collection is created.
◆ onDropCollection()
void mongo::UUIDCatalog::onDropCollection |
( |
OperationContext * |
opCtx, |
|
|
CollectionUUID |
uuid |
|
) |
| |
This function removes the entry for uuid from the UUID catalog.
It is called by the op observer when a collection is dropped.
◆ onOpenCatalog()
void mongo::UUIDCatalog::onOpenCatalog |
( |
| ) |
|
Puts the catatlog back in open state, removing the pre-close state.
See onCloseCatalog.
◆ onRenameCollection()
This function atomically removes any existing entry for uuid from the UUID catalog and adds a new entry for uuid associated with the Collection coll.
It is called by the op observer when a collection is renamed.
◆ prev()
Return the UUID lexicographically preceding uuid
in the database named by db
.
Return boost::none
if uuid
is not found, or is the first UUID in that database.
◆ registerUUIDCatalogEntry()
◆ removeUUIDCatalogEntry()
◆ replaceUUIDCatalogEntry()
◆ _catalog
◆ _catalogLock
mongo::stdx::mutex mongo::UUIDCatalog::_catalogLock |
|
mutableprivate |
◆ _orderedCollections
StringMap<std::vector<CollectionUUID> > mongo::UUIDCatalog::_orderedCollections |
|
private |
Map from database names to ordered vector
s of their UUIDs.
Works as a cache of such orderings: every ordering in this map is guaranteed to be valid, but not all databases are guaranteed to have an ordering in it.
◆ _shadowCatalog
boost::optional< mongo::stdx::unordered_map<CollectionUUID, NamespaceString, CollectionUUID::Hash> > mongo::UUIDCatalog::_shadowCatalog |
|
private |
When present, indicates that the catalog is in closed state, and contains a map from UUID to pre-close NSS.
See also onCloseCatalog.
The documentation for this class was generated from the following files:
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/catalog/uuid_catalog.h
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/catalog/uuid_catalog.cpp