summaryrefslogtreecommitdiffstats
path: root/searchcorespi
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-11-28 13:58:51 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2016-12-12 02:55:39 +0100
commitaf3f0048f62e84e36bee3a69396d0e26894a51f0 (patch)
tree95b4a6beb3dfa5f165818753dd80b6b7e43093b5 /searchcorespi
parent390ab5ab4e529746f33732e4f07d9ab581dbc5bd (diff)
Reduce unneccessary code incluscion.
Diffstat (limited to 'searchcorespi')
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp11
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h6
2 files changed, 12 insertions, 5 deletions
diff --git a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp
index 53a2a4d59ea..ad96184cb57 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp
+++ b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp
@@ -4,6 +4,7 @@
#include <vespa/vespalib/util/closuretask.h>
#include <vespa/searchlib/fef/matchdatalayout.h>
#include <vespa/searchlib/query/tree/termnodes.h>
+#include <vespa/vespalib/stllike/hash_set.h>
#include <vespa/log/log.h>
LOG_SETUP(".searchcorespi.index.warmupindexcollection");
@@ -20,6 +21,12 @@ using vespalib::makeClosure;
using index::IDiskIndex;
using fastos::TimeStamp;
using fastos::ClockSystem;
+using TermMap = vespalib::hash_set<vespalib::string>;
+
+class FieldTermMap : public vespalib::hash_map<uint32_t, TermMap>
+{
+
+};
WarmupIndexCollection::WarmupIndexCollection(const WarmupConfig & warmupConfig,
ISearchableIndexCollection::SP prev,
@@ -34,7 +41,7 @@ WarmupIndexCollection::WarmupIndexCollection(const WarmupConfig & warmupConfig,
_executor(executor),
_warmupDone(warmupDone),
_warmupEndTime(ClockSystem::now() + TimeStamp::Seconds(warmupConfig.getDuration())),
- _handledTerms()
+ _handledTerms(std::make_unique<FieldTermMap>())
{
if (next->valid()) {
setCurrentIndex(next->getCurrentIndex());
@@ -126,7 +133,7 @@ WarmupIndexCollection::handledBefore(uint32_t fieldId, const Node &term)
if (sb != NULL) {
const vespalib::string & s = sb->getTerm();
vespalib::LockGuard guard(_lock);
- TermMap::insert_result found = _handledTerms[fieldId].insert(s);
+ TermMap::insert_result found = (*_handledTerms)[fieldId].insert(s);
return ! found.second;
}
return true;
diff --git a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h
index be25b81d498..21a96e2bcff 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h
@@ -9,6 +9,8 @@
namespace searchcorespi {
+class FieldTermMap;
+
class IWarmupDone {
public:
virtual ~IWarmupDone() { }
@@ -108,9 +110,7 @@ private:
IWarmupDone & _warmupDone;
fastos::TimeStamp _warmupEndTime;
vespalib::Lock _lock;
- typedef vespalib::hash_set<vespalib::string> TermMap;
- typedef vespalib::hash_map<uint32_t, TermMap> FieldTermMap;
- FieldTermMap _handledTerms;
+ std::unique_ptr<FieldTermMap> _handledTerms;
};
} // namespace searchcorespi