diff --git a/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.cpp b/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.cpp index 7ee9f284f3f6..49d5fc4e42b1 100644 --- a/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.cpp +++ b/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.cpp @@ -14,8 +14,8 @@ namespace proton { DiskIndexWrapper::DiskIndexWrapper(const std::string &indexDir, const TuneFileSearch &tuneFileSearch, std::shared_ptr posting_list_cache, - size_t cacheSize) - : _index(indexDir, std::move(posting_list_cache), cacheSize), + size_t dictionary_cache_size) + : _index(indexDir, std::move(posting_list_cache), dictionary_cache_size), _serialNum(0) { bool setupIndexOk = _index.setup(tuneFileSearch); @@ -26,8 +26,8 @@ DiskIndexWrapper::DiskIndexWrapper(const std::string &indexDir, DiskIndexWrapper::DiskIndexWrapper(const DiskIndexWrapper &oldIndex, const TuneFileSearch &tuneFileSearch, - size_t cacheSize) - : _index(oldIndex._index.getIndexDir(), oldIndex._index.get_posting_list_cache(), cacheSize), + size_t dictionary_cache_size) + : _index(oldIndex._index.getIndexDir(), oldIndex._index.get_posting_list_cache(), dictionary_cache_size), _serialNum(0) { bool setupIndexOk = _index.setup(tuneFileSearch, oldIndex._index); diff --git a/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.h b/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.h index d493c16be79f..efe1dd87a287 100644 --- a/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.h +++ b/searchcore/src/vespa/searchcore/proton/index/diskindexwrapper.h @@ -17,11 +17,11 @@ class DiskIndexWrapper : public searchcorespi::index::IDiskIndex { DiskIndexWrapper(const std::string &indexDir, const search::TuneFileSearch &tuneFileSearch, std::shared_ptr posting_list_cache, - size_t cacheSize); + size_t dictionary_cache_size); DiskIndexWrapper(const DiskIndexWrapper &oldIndex, const search::TuneFileSearch &tuneFileSearch, - size_t cacheSize); + size_t dictionary_cache_size); std::unique_ptr createBlueprint(const IRequestContext & requestContext, const FieldSpec &field, const Node &term) override { diff --git a/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp b/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp index ae25c12cfa94..e9cd4ca182e7 100644 --- a/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp @@ -31,10 +31,10 @@ namespace proton::index { IndexManager::MaintainerOperations::MaintainerOperations(const FileHeaderContext &fileHeaderContext, const TuneFileIndexManager &tuneFileIndexManager, std::shared_ptr posting_list_cache, - size_t cacheSize, + size_t dictionary_cache_size, IThreadingService &threadingService) : _posting_list_cache(std::move(posting_list_cache)), - _cacheSize(cacheSize), + _dictionary_cache_size(dictionary_cache_size), _fileHeaderContext(fileHeaderContext), _tuneFileIndexing(tuneFileIndexManager._indexing), _tuneFileSearch(tuneFileIndexManager._search), @@ -54,14 +54,14 @@ IndexManager::MaintainerOperations::createMemoryIndex(const Schema& schema, IDiskIndex::SP IndexManager::MaintainerOperations::loadDiskIndex(const std::string &indexDir) { - return std::make_shared(indexDir, _tuneFileSearch, _posting_list_cache, _cacheSize); + return std::make_shared(indexDir, _tuneFileSearch, _posting_list_cache, _dictionary_cache_size); } IDiskIndex::SP IndexManager::MaintainerOperations::reloadDiskIndex(const IDiskIndex &oldIndex) { return std::make_shared(dynamic_cast(oldIndex), - _tuneFileSearch, _cacheSize); + _tuneFileSearch, _dictionary_cache_size); } bool @@ -90,7 +90,7 @@ IndexManager::IndexManager(const std::string &baseDir, const search::TuneFileIndexManager &tuneFileIndexManager, const search::TuneFileAttributes &tuneFileAttributes, const FileHeaderContext &fileHeaderContext) : - _operations(fileHeaderContext, tuneFileIndexManager, std::move(posting_list_cache), indexConfig.cacheSize, threadingService), + _operations(fileHeaderContext, tuneFileIndexManager, std::move(posting_list_cache), indexConfig.dictionary_cache_size, threadingService), _maintainer(IndexMaintainerConfig(baseDir, indexConfig.warmup, indexConfig.maxFlushed, schema, serialNum, tuneFileAttributes), IndexMaintainerContext(threadingService, reconfigurer, fileHeaderContext, warmupExecutor), _operations) diff --git a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h index 405139b7a40a..f48087be71ea 100644 --- a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h +++ b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h @@ -14,15 +14,15 @@ namespace proton::index { struct IndexConfig { using WarmupConfig = searchcorespi::index::WarmupConfig; IndexConfig() : IndexConfig(WarmupConfig(), 2, 0) { } - IndexConfig(WarmupConfig warmup_, size_t maxFlushed_, size_t cacheSize_) + IndexConfig(WarmupConfig warmup_, size_t maxFlushed_, size_t dictionary_cache_size_in) : warmup(warmup_), maxFlushed(maxFlushed_), - cacheSize(cacheSize_) + dictionary_cache_size(dictionary_cache_size_in) { } const WarmupConfig warmup; const size_t maxFlushed; - const size_t cacheSize; + const size_t dictionary_cache_size; }; /** @@ -39,7 +39,7 @@ class IndexManager : public searchcorespi::IIndexManager using IDiskIndex = searchcorespi::index::IDiskIndex; using IMemoryIndex = searchcorespi::index::IMemoryIndex; std::shared_ptr _posting_list_cache; - const size_t _cacheSize; + const size_t _dictionary_cache_size; const search::common::FileHeaderContext &_fileHeaderContext; const search::TuneFileIndexing _tuneFileIndexing; const search::TuneFileSearch _tuneFileSearch; @@ -49,7 +49,7 @@ class IndexManager : public searchcorespi::IIndexManager MaintainerOperations(const search::common::FileHeaderContext &fileHeaderContext, const search::TuneFileIndexManager &tuneFileIndexManager, std::shared_ptr posting_list_cache, - size_t cacheSize, + size_t dictionary_cache_size, searchcorespi::index::IThreadingService &threadingService); IMemoryIndex::SP createMemoryIndex(const Schema& schema, diff --git a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp index ced0a301fd25..77759cd60e72 100644 --- a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp @@ -46,15 +46,15 @@ DiskIndex::Key::Key(const Key &) = default; DiskIndex::Key & DiskIndex::Key::operator = (const Key &) = default; DiskIndex::Key::~Key() = default; -DiskIndex::DiskIndex(const std::string &indexDir, std::shared_ptr posting_list_cache, size_t cacheSize) +DiskIndex::DiskIndex(const std::string &indexDir, std::shared_ptr posting_list_cache, size_t dictionary_cache_size) : _indexDir(indexDir), - _cacheSize(cacheSize), + _dictionary_cache_size(dictionary_cache_size), _schema(), _field_indexes(), _nonfield_size_on_disk(0), _tuneFileSearch(), _posting_list_cache(std::move(posting_list_cache)), - _cache(*this, cacheSize) + _cache(*this, dictionary_cache_size) { calculate_nonfield_size_on_disk(); } @@ -198,7 +198,7 @@ DiskIndex::lookup(const std::vector & indexes, std::string_view word) { Key key(indexes, word); LookupResultVector result; - if (_cacheSize > 0) { + if (_dictionary_cache_size > 0) { result = _cache.read(key); if (!containsAll(indexes, result)) { key = Key(unite(indexes, result), word); diff --git a/searchlib/src/vespa/searchlib/diskindex/diskindex.h b/searchlib/src/vespa/searchlib/diskindex/diskindex.h index 5d16a3c079d7..d692e1a16a7d 100644 --- a/searchlib/src/vespa/searchlib/diskindex/diskindex.h +++ b/searchlib/src/vespa/searchlib/diskindex/diskindex.h @@ -57,7 +57,7 @@ class DiskIndex : public queryeval::Searchable { using Cache = vespalib::cache, DiskIndex>>; std::string _indexDir; - size_t _cacheSize; + size_t _dictionary_cache_size; index::Schema _schema; std::vector _field_indexes; uint32_t _nonfield_size_on_disk; @@ -74,10 +74,10 @@ class DiskIndex : public queryeval::Searchable { * Create a view of the disk index located in the given directory. * * @param indexDir the directory where the disk index is located. - * @param cacheSize optional size (in bytes) of the disk dictionary lookup cache. + * @param dictionary_cache_size optional size (in bytes) of the disk dictionary lookup cache. */ explicit DiskIndex(const std::string &indexDir, std::shared_ptr posting_list_cache, - size_t cacheSize = 0); + size_t dictionary_cache_size = 0); ~DiskIndex() override; /**