summaryrefslogtreecommitdiff
path: root/src/mongo/db/cloner.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2014-04-30 14:14:30 -0400
committerMathias Stearn <mathias@10gen.com>2014-04-30 14:52:09 -0400
commit57e01bdc252cb06225edb0ac5fc712666236dbcf (patch)
tree11be8be703f90d27a988f9850b615ac25bdb18f3 /src/mongo/db/cloner.h
parente762bdce1224dd40a6848864f072567979db6560 (diff)
downloadmongo-57e01bdc252cb06225edb0ac5fc712666236dbcf.tar.gz
SERVER-13643 Plumb TransactionExperiment through Cloner
Diffstat (limited to 'src/mongo/db/cloner.h')
-rw-r--r--src/mongo/db/cloner.h41
1 files changed, 30 insertions, 11 deletions
diff --git a/src/mongo/db/cloner.h b/src/mongo/db/cloner.h
index 255c1442f0b..1cd9e06989f 100644
--- a/src/mongo/db/cloner.h
+++ b/src/mongo/db/cloner.h
@@ -40,6 +40,7 @@ namespace mongo {
class DBClientBase;
class DBClientCursor;
class Query;
+ class TransactionExperiment;
class Cloner: boost::noncopyable {
public:
@@ -54,13 +55,20 @@ namespace mongo {
void setConnection( DBClientBase *c ) { _conn.reset( c ); }
/** copy the entire database */
- bool go(Client::Context& ctx,
- const string& masterHost, const CloneOptions& opts,
+ bool go(TransactionExperiment* txn,
+ Client::Context& ctx,
+ const string& masterHost,
+ const CloneOptions& opts,
set<string>* clonedColls,
string& errmsg, int *errCode = 0);
- bool copyCollection(const string& ns, const BSONObj& query, string& errmsg,
- bool mayYield, bool mayBeInterrupted, bool copyIndexes = true,
+ bool copyCollection(TransactionExperiment* txn,
+ const string& ns,
+ const BSONObj& query,
+ string& errmsg,
+ bool mayYield,
+ bool mayBeInterrupted,
+ bool copyIndexes = true,
bool logForRepl = true );
/**
* validate the cloner query was successful
@@ -77,20 +85,31 @@ namespace mongo {
* Currently this will only be set if there is an error in the initial
* system.namespaces query.
*/
- static bool cloneFrom(Client::Context& context,
- const string& masterHost, const CloneOptions& options,
- string& errmsg, int* errCode = 0,
+ static bool cloneFrom(TransactionExperiment* txn,
+ Client::Context& context,
+ const string& masterHost,
+ const CloneOptions& options,
+ string& errmsg,
+ int* errCode = 0,
set<string>* clonedCollections = 0);
/**
* Copy a collection (and indexes) from a remote host
*/
- static bool copyCollectionFromRemote(const string& host, const string& ns, string& errmsg);
+ static bool copyCollectionFromRemote(TransactionExperiment* txn,
+ const string& host, const string& ns, string& errmsg);
private:
- void copy(Client::Context& ctx,
- const char *from_ns, const char *to_ns, bool isindex, bool logForRepl,
- bool masterSameProcess, bool slaveOk, bool mayYield, bool mayBeInterrupted,
+ void copy(TransactionExperiment* txn,
+ Client::Context& ctx,
+ const char *from_ns,
+ const char *to_ns,
+ bool isindex,
+ bool logForRepl,
+ bool masterSameProcess,
+ bool slaveOk,
+ bool mayYield,
+ bool mayBeInterrupted,
Query q);
struct Fun;