diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-12-06 15:19:26 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-12-07 10:32:18 +0000 |
commit | 8535cbb1cfde7c23d4947a9b1a1e062b0469c722 (patch) | |
tree | b8ed147de52e6597345119a05dcb44a7dd6ccd8b /searchcorespi | |
parent | 351229b42387bbef47163e423f0c1c570f1dbeb1 (diff) |
Use alternate maxflushed parameter (max number of flushed memory indexes
before fusion becomes urgent) when node is retired.
Diffstat (limited to 'searchcorespi')
4 files changed, 17 insertions, 1 deletions
diff --git a/searchcorespi/src/tests/plugin/plugin.cpp b/searchcorespi/src/tests/plugin/plugin.cpp index bea732f3db6..5614ea1da3a 100644 --- a/searchcorespi/src/tests/plugin/plugin.cpp +++ b/searchcorespi/src/tests/plugin/plugin.cpp @@ -35,6 +35,7 @@ public: return l; } virtual void setSchema(const Schema &, SerialNum) override { } + virtual void setMaxFlushed(uint32_t) override { } }; class IndexManagerFactory : public searchcorespi::IIndexManagerFactory diff --git a/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h b/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h index b6538bd1ade..c529fe01dee 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h +++ b/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h @@ -157,6 +157,13 @@ public: * @param schema The new schema to start using. **/ virtual void setSchema(const Schema &schema, SerialNum serialNum) = 0; + + /* + * Sets the max number of flushed indexes before fusion is urgent. + * + * @param maxFlushed The max number of flushed indexes before fusion is urgent. + */ + virtual void setMaxFlushed(uint32_t maxFlushed) = 0; }; } // namespace searchcorespi diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp index d18ff417074..a18d24931cb 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp @@ -1085,9 +1085,9 @@ IndexMaintainer::getFusionStats() const { LockGuard lock(_new_search_lock); source_list = _source_list; + stats.maxFlushed = _maxFlushed; } stats.diskUsage = source_list->getSearchableStats().sizeOnDisk(); - stats.maxFlushed = _maxFlushed; { LockGuard guard(_fusion_lock); stats.numUnfused = _fusion_spec.flush_ids.size() + ((_fusion_spec.last_fusion_id != 0) ? 1 : 0); @@ -1228,5 +1228,12 @@ IndexMaintainer::pruneRemovedFields(const Schema &schema, SerialNum serialNum) } } +void +IndexMaintainer::setMaxFlushed(uint32_t maxFlushed) +{ + LockGuard lock(_new_search_lock); + _maxFlushed = maxFlushed; +} + } // namespace index } // namespace searchcorespi diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h index 133784f3b57..fb0bc2e5e78 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h @@ -383,6 +383,7 @@ public: IFlushTarget::List getFlushTargets() override; void setSchema(const Schema & schema, SerialNum serialNum) override ; + void setMaxFlushed(uint32_t maxFlushed) override; }; } // namespace index |