summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/database_impl.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2018-10-04 18:27:48 -0400
committerDavid Storch <david.storch@10gen.com>2018-10-23 17:18:11 -0400
commit2cdc2a96e1c8779658fe0eab459dcc38cf01c54d (patch)
tree875f55acaaba283f02895938ee4b6c764eac349a /src/mongo/db/catalog/database_impl.h
parente7bed9bdcb376d5a06dce6228047309e8481f9cf (diff)
downloadmongo-2cdc2a96e1c8779658fe0eab459dcc38cf01c54d.tar.gz
SERVER-37443 Make catalog objects survive collection rename.
This change only applies to collection renames within the same database. Rename across databases requires copying the data, and the resulting collection will have a new UUID.
Diffstat (limited to 'src/mongo/db/catalog/database_impl.h')
-rw-r--r--src/mongo/db/catalog/database_impl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/catalog/database_impl.h b/src/mongo/db/catalog/database_impl.h
index 38213e06055..5a2e95070f7 100644
--- a/src/mongo/db/catalog/database_impl.h
+++ b/src/mongo/db/catalog/database_impl.h
@@ -50,7 +50,6 @@ namespace mongo {
class Collection;
class DatabaseCatalogEntry;
class IndexCatalog;
-class NamespaceDetails;
class OperationContext;
class PseudoRandom;
@@ -202,6 +201,11 @@ public:
Collection* getOrCreateCollection(OperationContext* opCtx, const NamespaceString& nss) final;
+ /**
+ * Renames the fully qualified namespace 'fromNS' to the fully qualified namespace 'toNS'.
+ * Illegal to call unless both 'fromNS' and 'toNS' are within this database. Returns an error if
+ * 'toNS' already exists or 'fromNS' does not exist.
+ */
Status renameCollection(OperationContext* opCtx,
StringData fromNS,
StringData toNS,
@@ -272,6 +276,7 @@ private:
class AddCollectionChange;
class RemoveCollectionChange;
+ class RenameCollectionChange;
const std::string _name; // "dbname"
@@ -300,7 +305,6 @@ private:
Database* _this; // Pointer to wrapper, for external caller compatibility.
friend class Collection;
- friend class NamespaceDetails;
friend class IndexCatalog;
};