summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/repl_settings.cpp
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2016-05-31 12:10:45 -0400
committerEric Milkie <milkie@10gen.com>2016-06-01 09:52:41 -0400
commitb360d5833b6c20ddc64b8a18456b359aa718e3fe (patch)
tree04f75f6b4c858031726e28d6742f533eb40fc6d6 /src/mongo/db/repl/repl_settings.cpp
parentb02759c687efcde72a0343532ae4c1b896d1db64 (diff)
downloadmongo-b360d5833b6c20ddc64b8a18456b359aa718e3fe.tar.gz
SERVER-24318 change BackgroundSync to one owned object by the Repl ExternalState, to simplify lifetime issues
Diffstat (limited to 'src/mongo/db/repl/repl_settings.cpp')
-rw-r--r--src/mongo/db/repl/repl_settings.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mongo/db/repl/repl_settings.cpp b/src/mongo/db/repl/repl_settings.cpp
index b2049ba8776..c31f8bc5012 100644
--- a/src/mongo/db/repl/repl_settings.cpp
+++ b/src/mongo/db/repl/repl_settings.cpp
@@ -29,9 +29,12 @@
#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kReplication
#include "mongo/db/repl/repl_settings.h"
-#include "mongo/util/log.h"
+
#include <string>
+#include "mongo/db/repl/bgsync.h"
+#include "mongo/util/log.h"
+
namespace mongo {
namespace repl {
@@ -93,12 +96,12 @@ std::string ReplSettings::getReplSetString() const {
return _replSetString;
}
-BackgroundSync::IndexPrefetchConfig ReplSettings::getPrefetchIndexMode() const {
+ReplSettings::IndexPrefetchConfig ReplSettings::getPrefetchIndexMode() const {
return _prefetchIndexMode;
}
bool ReplSettings::isPrefetchIndexModeSet() const {
- return _prefetchIndexMode != BackgroundSync::UNINITIALIZED;
+ return _prefetchIndexMode != IndexPrefetchConfig::UNINITIALIZED;
}
/**
@@ -150,16 +153,16 @@ void ReplSettings::setReplSetString(std::string replSetString) {
void ReplSettings::setPrefetchIndexMode(std::string prefetchIndexModeString) {
if (prefetchIndexModeString.empty()) {
- _prefetchIndexMode = BackgroundSync::UNINITIALIZED;
+ _prefetchIndexMode = IndexPrefetchConfig::UNINITIALIZED;
} else {
if (prefetchIndexModeString == "none")
- _prefetchIndexMode = BackgroundSync::PREFETCH_NONE;
+ _prefetchIndexMode = IndexPrefetchConfig::PREFETCH_NONE;
else if (prefetchIndexModeString == "_id_only")
- _prefetchIndexMode = BackgroundSync::PREFETCH_ID_ONLY;
+ _prefetchIndexMode = IndexPrefetchConfig::PREFETCH_ID_ONLY;
else if (prefetchIndexModeString == "all")
- _prefetchIndexMode = BackgroundSync::PREFETCH_ALL;
+ _prefetchIndexMode = IndexPrefetchConfig::PREFETCH_ALL;
else {
- _prefetchIndexMode = BackgroundSync::PREFETCH_ALL;
+ _prefetchIndexMode = IndexPrefetchConfig::PREFETCH_ALL;
warning() << "unrecognized indexPrefetchMode setting \"" << prefetchIndexModeString
<< "\", defaulting to \"all\"";
}