diff options
Diffstat (limited to 'searchcorespi')
-rw-r--r-- | searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp | 11 | ||||
-rw-r--r-- | searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h | 6 |
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 |