summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/common/tunefileinfo.h5
-rw-r--r--searchlib/src/vespa/searchlib/common/tunefileinfo.hpp7
3 files changed, 12 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp
index 0c2870ad35d..edbf0c631a5 100644
--- a/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/bootstrapconfigmanager.cpp
@@ -84,7 +84,8 @@ BootstrapConfigManager::update(const ConfigSnapshot & snapshot)
tune._index._indexing._write.setFromConfig<ProtonConfig::Indexing::Write>(conf.indexing.write.io);
tune._index._indexing._read.setFromConfig<ProtonConfig::Indexing::Read>(conf.indexing.read.io);
tune._attr._write.setFromConfig<ProtonConfig::Attribute::Write>(conf.attribute.write.io);
- tune._index._search._read.setFromConfig<ProtonConfig::Search, ProtonConfig::Search::Mmap>(conf.search.io, conf.search.mmap);
+ tune._index._search._read.setWantMemoryMap();
+ tune._index._search._read.setFromMmapConfig<ProtonConfig::Search::Mmap>(conf.search.mmap);
tune._summary._write.setFromConfig<ProtonConfig::Summary::Write>(conf.summary.write.io);
tune._summary._seqRead.setFromConfig<ProtonConfig::Summary::Read>(conf.summary.read.io);
tune._summary._randRead.setFromConfig<ProtonConfig::Summary::Read, ProtonConfig::Summary::Read::Mmap>(conf.summary.read.io, conf.summary.read.mmap);
diff --git a/searchlib/src/vespa/searchlib/common/tunefileinfo.h b/searchlib/src/vespa/searchlib/common/tunefileinfo.h
index 223dcdbc7f1..edd6d29dd58 100644
--- a/searchlib/src/vespa/searchlib/common/tunefileinfo.h
+++ b/searchlib/src/vespa/searchlib/common/tunefileinfo.h
@@ -119,8 +119,9 @@ public:
int getAdvise() const { return _advise; }
template <typename TuneControlConfig, typename MMapConfig>
- void
- setFromConfig(const enum TuneControlConfig::Io & tuneControlConfig, const MMapConfig & mmapFlags);
+ void setFromConfig(const enum TuneControlConfig::Io & tuneControlConfig, const MMapConfig & mmapFlags);
+ template <typename MMapConfig>
+ void setFromMmapConfig(const MMapConfig & mmapFlags);
bool operator==(const TuneFileRandRead &rhs) const {
return (_tuneControl == rhs._tuneControl) && (_mmapFlags == rhs._mmapFlags);
diff --git a/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp b/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp
index 22d89d904d2..08acd2caa97 100644
--- a/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp
+++ b/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp
@@ -1,3 +1,4 @@
+
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
@@ -17,6 +18,12 @@ TuneFileRandRead::setFromConfig(const enum TuneControlConfig::Io & tuneControlCo
case TuneControlConfig::MMAP: _tuneControl = MMAP; break;
default: _tuneControl = NORMAL; break;
}
+ setFromMmapConfig(mmapFlags);
+}
+
+template <typename MMapConfig>
+void
+TuneFileRandRead::setFromMmapConfig(const MMapConfig & mmapFlags) {
for (size_t i(0), m(mmapFlags.options.size()); i < m; i++) {
switch (mmapFlags.options[i]) {
case MMapConfig::MLOCK: _mmapFlags |= MAP_LOCKED; break;