Storage Engine API
rename_collection.h
Go to the documentation of this file.
1 
29 #include "mongo/base/status.h"
30 #include "mongo/bson/bsonelement.h"
31 #include "mongo/bson/bsonobj.h"
33 #include "mongo/util/uuid.h"
34 
35 namespace mongo {
36 class NamespaceString;
37 class OperationContext;
38 
39 namespace repl {
40 class OpTime;
41 } // namespace repl
42 
49  bool dropTarget = false;
51  bool stayTemp = false;
52 };
53 Status renameCollection(OperationContext* opCtx,
54  const NamespaceString& source,
55  const NamespaceString& target,
56  const RenameCollectionOptions& options);
57 
65 Status renameCollectionForApplyOps(OperationContext* opCtx,
66  const std::string& dbName,
67  const BSONElement& ui,
68  const BSONObj& cmd,
69  const repl::OpTime& renameOpTime);
70 
77 Status renameCollectionForRollback(OperationContext* opCtx,
78  const NamespaceString& target,
79  const UUID& uuid);
80 
81 } // namespace mongo
Status renameCollection(OperationContext *opCtx, const NamespaceString &source, const NamespaceString &target, const RenameCollectionOptions &options)
Definition: rename_collection.cpp:477
Status renameCollectionForApplyOps(OperationContext *opCtx, const std::string &dbName, const BSONElement &ui, const BSONObj &cmd, const repl::OpTime &renameOpTime)
As above, but may only be called from applyCommand_inlock.
Definition: rename_collection.cpp:497
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
Status renameCollectionForRollback(OperationContext *opCtx, const NamespaceString &target, const UUID &uuid)
Same as renameCollection(), but used for rolling back renameCollection operations only.
Definition: rename_collection.cpp:573
bool dropTarget
Definition: rename_collection.h:49
Renames the collection from "source" to "target" and drops the existing collection with UUID dropTarg...
Definition: rename_collection.h:48
OperationContext Database StringData CollectionOptions bool const BSONObj &idIndex Status
Definition: database_impl.cpp:955
boost::optional< CollectionUUID > OptionalCollectionUUID
Definition: collection_options.h:55
Collection *const OperationContext *const const StringData OptionalCollectionUUID uuid
Definition: collection_impl.cpp:80
bool stayTemp
Definition: rename_collection.h:51
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
OptionalCollectionUUID dropTargetUUID
Definition: rename_collection.h:50