summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/sync.h
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2013-02-26 20:01:12 -0500
committerEric Milkie <milkie@10gen.com>2013-03-11 11:15:02 -0400
commitc77acec063b7319a2e2bb4d304cb3d5abb563c29 (patch)
tree100729d5b80a3d30e675f7eb8ac4235e7fae5263 /src/mongo/db/repl/sync.h
parent753dc84327d166c2973d268d5c6f05fef64195bb (diff)
downloadmongo-c77acec063b7319a2e2bb4d304cb3d5abb563c29.tar.gz
SERVER-7772 separate out Sync class
Diffstat (limited to 'src/mongo/db/repl/sync.h')
-rw-r--r--src/mongo/db/repl/sync.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/mongo/db/repl/sync.h b/src/mongo/db/repl/sync.h
new file mode 100644
index 00000000000..9bf2b87ae99
--- /dev/null
+++ b/src/mongo/db/repl/sync.h
@@ -0,0 +1,40 @@
+/**
+* Copyright (C) 2008 10gen Inc.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License, version 3,
+* as published by the Free Software Foundation.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#pragma once
+
+#include <string>
+
+#include "mongo/db/jsobj.h"
+
+namespace mongo {
+
+ class Sync {
+ protected:
+ string hn;
+ public:
+ Sync(const string& hostname) : hn(hostname) {}
+ virtual ~Sync() {}
+ virtual BSONObj getMissingDoc(const BSONObj& o);
+
+ /**
+ * If applyOperation_inlock should be called again after an update fails.
+ */
+ virtual bool shouldRetry(const BSONObj& o);
+ void setHostname(const string& hostname);
+ };
+
+}