diff options
author | Geir Storli <geirstorli@yahoo.no> | 2017-05-03 09:37:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-03 09:37:22 +0200 |
commit | 3cd9c747e62ee82edfb5fedf4415f5daa45b3ab3 (patch) | |
tree | 0b798d9c6443d97de3adc0422d424edc7a8776c4 /searchlib | |
parent | 1885cea8e81c782546904e178a866b8ecbe6bf69 (diff) | |
parent | bf37857692d69c5efb4f2c5376f97f5895ced727 (diff) |
Merge pull request #2292 from yahoo/toregge/remove-wipe-history-usage-2-try-2
Toregge/remove wipe history usage 2 try 2
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/common/lambdatask.h | 2 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp | 20 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/memoryindex/memoryindex.h | 7 |
3 files changed, 14 insertions, 15 deletions
diff --git a/searchlib/src/vespa/searchlib/common/lambdatask.h b/searchlib/src/vespa/searchlib/common/lambdatask.h index d03d23ba3dd..e6fb87e95dc 100644 --- a/searchlib/src/vespa/searchlib/common/lambdatask.h +++ b/searchlib/src/vespa/searchlib/common/lambdatask.h @@ -13,7 +13,7 @@ class LambdaTask : public vespalib::Executor::Task { public: LambdaTask(const FunctionType &func) : _func(func) {} LambdaTask(FunctionType &&func) : _func(std::move(func)) {} - virtual void run() { _func(); } + virtual void run() override { _func(); } }; template <class FunctionType> diff --git a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp index 34021ebeab6..6d745f7215e 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp @@ -62,7 +62,7 @@ MemoryIndex::MemoryIndex(const Schema &schema, _numDocs(0), _lock(), _hiddenFields(schema.getNumIndexFields(), false), - _wipeTimeSchema(), + _prunedSchema(), _indexedDocs(0), _staticMemoryFootprint(getMemoryUsage().allocatedBytes()) { @@ -257,34 +257,34 @@ MemoryIndex::getMemoryUsage() const } void -MemoryIndex::wipeHistory(const Schema &schema) +MemoryIndex::pruneRemovedFields(const Schema &schema) { LockGuard lock(_lock); - if (_wipeTimeSchema.get() == NULL) { + if (_prunedSchema.get() == NULL) { Schema::UP newSchema = Schema::intersect(_schema, schema); if (_schema == *newSchema) return; - _wipeTimeSchema.reset(newSchema.release()); + _prunedSchema.reset(newSchema.release()); } else { - Schema::UP newSchema = Schema::intersect(*_wipeTimeSchema, schema); - if (*_wipeTimeSchema == *newSchema) + Schema::UP newSchema = Schema::intersect(*_prunedSchema, schema); + if (*_prunedSchema == *newSchema) return; - _wipeTimeSchema.reset(newSchema.release()); + _prunedSchema.reset(newSchema.release()); } SchemaUtil::IndexIterator i(_schema); for (; i.isValid(); ++i) { uint32_t packedIndex = i.getIndex(); assert(packedIndex < _hiddenFields.size()); - SchemaUtil::IndexIterator wi(*_wipeTimeSchema, i); + SchemaUtil::IndexIterator wi(*_prunedSchema, i); _hiddenFields[packedIndex] = !wi.isValid(); } } Schema::SP -MemoryIndex::getWipeTimeSchema() const +MemoryIndex::getPrunedSchema() const { LockGuard lock(_lock); - return _wipeTimeSchema; + return _prunedSchema; } } // namespace memoryindex diff --git a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.h b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.h index 10ab298bd80..242f575ea1d 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.h +++ b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.h @@ -36,7 +36,7 @@ private: uint32_t _numDocs; vespalib::Lock _lock; std::vector<bool> _hiddenFields; - index::Schema::SP _wipeTimeSchema; + index::Schema::SP _prunedSchema; vespalib::hash_set<uint32_t> _indexedDocs; // documents in memory index const uint64_t _staticMemoryFootprint; @@ -162,10 +162,9 @@ public: return _dictionary.getNumUniqueWords(); } - void - wipeHistory(const index::Schema &schema); + void pruneRemovedFields(const index::Schema &schema); - index::Schema::SP getWipeTimeSchema() const; + index::Schema::SP getPrunedSchema() const; /** * Gets an approximation of how much memory the index uses. |