summaryrefslogtreecommitdiff
path: root/src/mongo/db/cloner.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 00:22:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 10:56:02 -0400
commit9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch)
tree3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/cloner.h
parent01965cf52bce6976637ecb8f4a622aeb05ab256a (diff)
downloadmongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/cloner.h')
-rw-r--r--src/mongo/db/cloner.h173
1 files changed, 87 insertions, 86 deletions
diff --git a/src/mongo/db/cloner.h b/src/mongo/db/cloner.h
index 2009d971869..3d49cf01a05 100644
--- a/src/mongo/db/cloner.h
+++ b/src/mongo/db/cloner.h
@@ -35,92 +35,93 @@
namespace mongo {
- struct CloneOptions;
- class DBClientBase;
- class NamespaceString;
- class OperationContext;
-
-
- class Cloner {
- MONGO_DISALLOW_COPYING(Cloner);
- public:
- Cloner();
-
- void setConnection(DBClientBase* c) {
- _conn.reset(c);
- }
-
- /**
- * Copies an entire database from the specified host.
- */
- Status copyDb(OperationContext* txn,
- const std::string& toDBName,
- const std::string& masterHost,
- const CloneOptions& opts,
- std::set<std::string>* clonedColls);
-
- bool copyCollection(OperationContext* txn,
- const std::string& ns,
- const BSONObj& query,
- std::string& errmsg,
- bool mayYield,
- bool mayBeInterrupted,
- bool copyIndexes = true);
-
- private:
- void copy(OperationContext* txn,
- const std::string& toDBName,
- const NamespaceString& from_ns,
- const NamespaceString& to_ns,
- bool masterSameProcess,
- bool slaveOk,
- bool mayYield,
- bool mayBeInterrupted,
- Query q);
-
- void copyIndexes(OperationContext* txn,
- const std::string& toDBName,
- const NamespaceString& from_ns,
- const NamespaceString& to_ns,
- bool masterSameProcess,
- bool slaveOk,
- bool mayYield,
- bool mayBeInterrupted);
-
- struct Fun;
- std::unique_ptr<DBClientBase> _conn;
- };
+struct CloneOptions;
+class DBClientBase;
+class NamespaceString;
+class OperationContext;
+
+
+class Cloner {
+ MONGO_DISALLOW_COPYING(Cloner);
+
+public:
+ Cloner();
+
+ void setConnection(DBClientBase* c) {
+ _conn.reset(c);
+ }
/**
- * slaveOk - if true it is ok if the source of the data is !ismaster.
- * useReplAuth - use the credentials we normally use as a replication slave for the cloning
- * snapshot - use $snapshot mode for copying collections. note this should not be used
- * when it isn't required, as it will be slower. for example,
- * repairDatabase need not use it.
+ * Copies an entire database from the specified host.
*/
- struct CloneOptions {
- CloneOptions() {
- slaveOk = false;
- useReplAuth = false;
- snapshot = true;
- mayYield = true;
- mayBeInterrupted = false;
-
- syncData = true;
- syncIndexes = true;
- }
-
- std::string fromDB;
- std::set<std::string> collsToIgnore;
-
- bool slaveOk;
- bool useReplAuth;
- bool snapshot;
- bool mayYield;
- bool mayBeInterrupted;
-
- bool syncData;
- bool syncIndexes;
- };
-
-} // namespace mongo
+ Status copyDb(OperationContext* txn,
+ const std::string& toDBName,
+ const std::string& masterHost,
+ const CloneOptions& opts,
+ std::set<std::string>* clonedColls);
+
+ bool copyCollection(OperationContext* txn,
+ const std::string& ns,
+ const BSONObj& query,
+ std::string& errmsg,
+ bool mayYield,
+ bool mayBeInterrupted,
+ bool copyIndexes = true);
+
+private:
+ void copy(OperationContext* txn,
+ const std::string& toDBName,
+ const NamespaceString& from_ns,
+ const NamespaceString& to_ns,
+ bool masterSameProcess,
+ bool slaveOk,
+ bool mayYield,
+ bool mayBeInterrupted,
+ Query q);
+
+ void copyIndexes(OperationContext* txn,
+ const std::string& toDBName,
+ const NamespaceString& from_ns,
+ const NamespaceString& to_ns,
+ bool masterSameProcess,
+ bool slaveOk,
+ bool mayYield,
+ bool mayBeInterrupted);
+
+ struct Fun;
+ std::unique_ptr<DBClientBase> _conn;
+};
+
+/**
+ * slaveOk - if true it is ok if the source of the data is !ismaster.
+ * useReplAuth - use the credentials we normally use as a replication slave for the cloning
+ * snapshot - use $snapshot mode for copying collections. note this should not be used
+ * when it isn't required, as it will be slower. for example,
+ * repairDatabase need not use it.
+ */
+struct CloneOptions {
+ CloneOptions() {
+ slaveOk = false;
+ useReplAuth = false;
+ snapshot = true;
+ mayYield = true;
+ mayBeInterrupted = false;
+
+ syncData = true;
+ syncIndexes = true;
+ }
+
+ std::string fromDB;
+ std::set<std::string> collsToIgnore;
+
+ bool slaveOk;
+ bool useReplAuth;
+ bool snapshot;
+ bool mayYield;
+ bool mayBeInterrupted;
+
+ bool syncData;
+ bool syncIndexes;
+};
+
+} // namespace mongo