From 1a840959d6af545d59deca756ee5a47d3170ab29 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Wed, 26 Apr 2017 09:55:41 +0000 Subject: Add override. --- searchlib/src/vespa/searchlib/common/lambdatask.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'searchlib') 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 -- cgit v1.2.3 From a3aef2d5cffd073f3d595cbb449382eb5d12086c Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Thu, 27 Apr 2017 09:38:05 +0000 Subject: Rename wipeHistory() to pruneRemovedFields() in handling of indexed fields. --- searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h | 4 ++-- searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h | 2 +- searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp | 8 ++++---- searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h | 2 +- searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp | 2 +- searchlib/src/vespa/searchlib/memoryindex/memoryindex.h | 3 +-- 6 files changed, 10 insertions(+), 11 deletions(-) (limited to 'searchlib') diff --git a/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h b/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h index 9f5c2290d2f..6c57298dc43 100644 --- a/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h +++ b/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h @@ -84,8 +84,8 @@ public: _index.commit(onWriteDone); _serialNum.store(serialNum, std::memory_order_relaxed); } - void wipeHistory(const search::index::Schema &schema) override { - _index.wipeHistory(schema); + void pruneRemovedFields(const search::index::Schema &schema) override { + _index.pruneRemovedFields(schema); } void flushToDisk(const vespalib::string &flushDir, uint32_t docIdLimit, SerialNum serialNum) override; }; diff --git a/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h b/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h index c8baaf9ca13..cdb94bf7a19 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h +++ b/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h @@ -77,7 +77,7 @@ struct IMemoryIndex : public searchcorespi::IndexSearchable { uint32_t docIdLimit, search::SerialNum serialNum) = 0; - virtual void wipeHistory(const search::index::Schema &schema) = 0; + virtual void pruneRemovedFields(const search::index::Schema &schema) = 0; virtual search::index::Schema::SP getWipeTimeSchema() const = 0; }; diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp index dfe5eaf67a1..c9329a20bc9 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp @@ -212,7 +212,7 @@ IndexMaintainer::updateIndexSchemas(IIndexCollection &coll, if (d == NULL) { IMemoryIndex *const m = dynamic_cast(&is); if (m != NULL) { - m->wipeHistory(schema); + m->pruneRemovedFields(schema); } continue; } @@ -871,7 +871,7 @@ IndexMaintainer::IndexMaintainer(const IndexMaintainerConfig &config, sourceList->setCurrentIndex(_current_index_id); _source_list = std::move(sourceList); _fusion_spec = spec; - _ctx.getThreadingService().master().execute(makeLambdaTask([this,&config]() {internalWipeHistory(_schema, config.getSerialNum()); })); + _ctx.getThreadingService().master().execute(makeLambdaTask([this,&config]() {pruneRemovedFields(_schema, config.getSerialNum()); })); _ctx.getThreadingService().master().sync(); } @@ -1187,7 +1187,7 @@ void IndexMaintainer::setSchema(const Schema & schema, SerialNum serialNum) { assert(_ctx.getThreadingService().master().isCurrentThread()); - internalWipeHistory(schema, serialNum); + pruneRemovedFields(schema, serialNum); IMemoryIndex::SP new_index(_operations.createMemoryIndex(schema, _current_serial_num)); SetSchemaArgs args; @@ -1202,7 +1202,7 @@ IndexMaintainer::setSchema(const Schema & schema, SerialNum serialNum) } void -IndexMaintainer::internalWipeHistory(const Schema &schema, SerialNum wipeSerial) +IndexMaintainer::pruneRemovedFields(const Schema &schema, SerialNum wipeSerial) { assert(_ctx.getThreadingService().master().isCurrentThread()); ISearchableIndexCollection::SP new_source_list; diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h index 3d28bf72b94..dcedd97abcb 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h @@ -287,7 +287,7 @@ class IndexMaintainer : public IIndexManager, bool makeSureAllRemainingWarmupIsDone(ISearchableIndexCollection::SP keepAlive); void scheduleCommit(); void commit(); - void internalWipeHistory(const Schema &schema, SerialNum wipeSerial); + void pruneRemovedFields(const Schema &schema, SerialNum wipeSerial); public: IndexMaintainer(const IndexMaintainer &) = delete; diff --git a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp index 34021ebeab6..b6aff679921 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp @@ -257,7 +257,7 @@ MemoryIndex::getMemoryUsage() const } void -MemoryIndex::wipeHistory(const Schema &schema) +MemoryIndex::pruneRemovedFields(const Schema &schema) { LockGuard lock(_lock); if (_wipeTimeSchema.get() == NULL) { diff --git a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.h b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.h index 10ab298bd80..40368bc8624 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.h +++ b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.h @@ -162,8 +162,7 @@ public: return _dictionary.getNumUniqueWords(); } - void - wipeHistory(const index::Schema &schema); + void pruneRemovedFields(const index::Schema &schema); index::Schema::SP getWipeTimeSchema() const; -- cgit v1.2.3 From 0be5796b9acce73035fa733a2307ce0515749faf Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Thu, 27 Apr 2017 10:53:09 +0000 Subject: Rename wipe time schema to pruned schema. --- .../searchcore/proton/index/memoryindexwrapper.h | 4 +- .../src/vespa/searchcorespi/index/imemoryindex.h | 2 +- .../vespa/searchcorespi/index/indexmaintainer.cpp | 82 +++++++++++----------- .../vespa/searchcorespi/index/indexmaintainer.h | 12 ++-- .../vespa/searchlib/memoryindex/memoryindex.cpp | 18 ++--- .../src/vespa/searchlib/memoryindex/memoryindex.h | 4 +- 6 files changed, 61 insertions(+), 61 deletions(-) (limited to 'searchlib') diff --git a/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h b/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h index 6c57298dc43..7ac74e4c73a 100644 --- a/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h +++ b/searchcore/src/vespa/searchcore/proton/index/memoryindexwrapper.h @@ -65,8 +65,8 @@ public: bool hasReceivedDocumentInsert() const override { return _index.getDocIdLimit() > 1u; } - search::index::Schema::SP getWipeTimeSchema() const override { - return _index.getWipeTimeSchema(); + search::index::Schema::SP getPrunedSchema() const override { + return _index.getPrunedSchema(); } search::MemoryUsage getMemoryUsage() const override { return _index.getMemoryUsage(); diff --git a/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h b/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h index cdb94bf7a19..ef04a90586a 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h +++ b/searchcorespi/src/vespa/searchcorespi/index/imemoryindex.h @@ -78,7 +78,7 @@ struct IMemoryIndex : public searchcorespi::IndexSearchable { search::SerialNum serialNum) = 0; virtual void pruneRemovedFields(const search::index::Schema &schema) = 0; - virtual search::index::Schema::SP getWipeTimeSchema() const = 0; + virtual search::index::Schema::SP getPrunedSchema() const = 0; }; } // namespace index diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp index c9329a20bc9..d3c622c6885 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp @@ -221,34 +221,34 @@ IndexMaintainer::updateIndexSchemas(IIndexCollection &coll, } void -IndexMaintainer::updateActiveFusionWipeTimeSchema(const Schema &schema) +IndexMaintainer::updateActiveFusionPrunedSchema(const Schema &schema) { assert(_ctx.getThreadingService().master().isCurrentThread()); for (;;) { Schema::SP activeFusionSchema; - Schema::SP activeFusionWipeTimeSchema; - Schema::SP newActiveFusionWipeTimeSchema; + Schema::SP activeFusionPrunedSchema; + Schema::SP newActiveFusionPrunedSchema; { LockGuard lock(_state_lock); activeFusionSchema = _activeFusionSchema; - activeFusionWipeTimeSchema = _activeFusionWipeTimeSchema; + activeFusionPrunedSchema = _activeFusionPrunedSchema; } - if (activeFusionSchema.get() == NULL) + if (!activeFusionSchema) return; // No active fusion - if (activeFusionWipeTimeSchema.get() == NULL) { + if (!activeFusionPrunedSchema) { Schema::UP newSchema = Schema::intersect(*activeFusionSchema, schema); - newActiveFusionWipeTimeSchema.reset(newSchema.release()); + newActiveFusionPrunedSchema.reset(newSchema.release()); } else { - Schema::UP newSchema = Schema::intersect(*activeFusionWipeTimeSchema, schema); - newActiveFusionWipeTimeSchema.reset(newSchema.release()); + Schema::UP newSchema = Schema::intersect(*activeFusionPrunedSchema, schema); + newActiveFusionPrunedSchema.reset(newSchema.release()); } { LockGuard slock(_state_lock); LockGuard ilock(_index_update_lock); - if (activeFusionSchema.get() == _activeFusionSchema.get() && - activeFusionWipeTimeSchema.get() == _activeFusionWipeTimeSchema.get()) + if (activeFusionSchema == _activeFusionSchema && + activeFusionPrunedSchema == _activeFusionPrunedSchema) { - _activeFusionWipeTimeSchema = newActiveFusionWipeTimeSchema; + _activeFusionPrunedSchema = newActiveFusionPrunedSchema; break; } } @@ -313,9 +313,9 @@ IndexMaintainer::flushMemoryIndex(IMemoryIndex &memoryIndex, // Called by a flush worker thread const string flushDir = getFlushDir(indexId); memoryIndex.flushToDisk(flushDir, docIdLimit, serialNum); - Schema::SP wtSchema(memoryIndex.getWipeTimeSchema()); - if (wtSchema.get() != NULL) { - updateDiskIndexSchema(flushDir, *wtSchema, noSerialNumHigh); + Schema::SP prunedSchema(memoryIndex.getPrunedSchema()); + if (prunedSchema) { + updateDiskIndexSchema(flushDir, *prunedSchema, noSerialNumHigh); } IndexWriteUtilities::writeSourceSelector(saveInfo, indexId, getAttrTune(), _ctx.getFileHeaderContext(), @@ -430,7 +430,7 @@ IndexMaintainer::FlushArgs::FlushArgs() _skippedEmptyLast(false), _extraIndexes(), _changeGens(), - _wtSchema() + _prunedSchema() { } IndexMaintainer::FlushArgs::~FlushArgs() { } @@ -556,14 +556,14 @@ IndexMaintainer::flushMemoryIndex(FlushArgs &args, // Called by a flush worker thread ChangeGens changeGens = getChangeGens(); IMemoryIndex &memoryIndex = *args.old_index; - Schema::SP wtSchema = memoryIndex.getWipeTimeSchema(); + Schema::SP prunedSchema = memoryIndex.getPrunedSchema(); IDiskIndex::SP diskIndex = flushMemoryIndex(memoryIndex, args.old_absolute_id, docIdLimit, args.flush_serial_num, saveInfo); // Post processing after memory index has been written to disk and // opened as disk index. args._changeGens = changeGens; - args._wtSchema = wtSchema; + args._prunedSchema = prunedSchema; reconfigureAfterFlush(args, diskIndex); flushIds.push_back(args.old_absolute_id); @@ -582,15 +582,15 @@ IndexMaintainer::reconfigureAfterFlush(FlushArgs &args, IDiskIndex::SP &diskInde return; } ChangeGens changeGens = getChangeGens(); - Schema::SP wtSchema = args.old_index->getWipeTimeSchema(); + Schema::SP prunedSchema = args.old_index->getPrunedSchema(); const string indexDir = getFlushDir(args.old_absolute_id); - if (wtSchema.get() != NULL) { - updateDiskIndexSchema(indexDir, *wtSchema, noSerialNumHigh); + if (prunedSchema) { + updateDiskIndexSchema(indexDir, *prunedSchema, noSerialNumHigh); } IDiskIndex::SP reloadedDiskIndex = reloadDiskIndex(*diskIndex); diskIndex = reloadedDiskIndex; args._changeGens = changeGens; - args._wtSchema = wtSchema; + args._prunedSchema = prunedSchema; } } @@ -604,7 +604,7 @@ IndexMaintainer::doneFlush(FlushArgs *args, IDiskIndex::SP *disk_index) { if (args->_changeGens != getChangeGens()) { return false; // Must retry operation } - if (args->_wtSchema.get() != memoryIndex.getWipeTimeSchema().get()) { + if (args->_prunedSchema != memoryIndex.getPrunedSchema()) { return false; // Must retry operation } _flush_serial_num = std::max(_flush_serial_num, args->flush_serial_num); @@ -642,7 +642,7 @@ IndexMaintainer::doneFusion(FusionArgs *args, IDiskIndex::SP *new_index) if (args->_changeGens != getChangeGens()) { return false; // Must retry operation } - if (args->_wtSchema.get() != getActiveFusionWipeTimeSchema().get()) { + if (args->_prunedSchema != getActiveFusionPrunedSchema()) { return false; // Must retry operation } args->_old_source_list = _source_list; // delays destruction @@ -659,7 +659,7 @@ IndexMaintainer::doneFusion(FusionArgs *args, IDiskIndex::SP *new_index) _last_fusion_id = args->_new_fusion_id; _selector->setBaseId(_last_fusion_id); _activeFusionSchema.reset(); - _activeFusionWipeTimeSchema.reset(); + _activeFusionPrunedSchema.reset(); } ISearchableIndexCollection::SP currentLeaf; @@ -686,7 +686,7 @@ IndexMaintainer::makeSureAllRemainingWarmupIsDone(ISearchableIndexCollection::SP ISearchableIndexCollection::SP warmIndex; { LockGuard state_lock(_state_lock); - if (keepAlive.get() == _source_list.get()) { + if (keepAlive == _source_list) { LockGuard lock(_new_search_lock); warmIndex = (getLeaf(lock, _source_list, false)); _source_list = warmIndex; @@ -706,7 +706,7 @@ IndexMaintainer::warmupDone(ISearchableIndexCollection::SP current) { // Called by a search thread LockGuard lock(_new_search_lock); - if (current.get() == _source_list.get()) { + if (current == _source_list) { auto makeSure = makeClosure(this, &IndexMaintainer::makeSureAllRemainingWarmupIsDone, current); Executor::Task::UP task(new ReconfigRunnableTask(_ctx.getReconfigurer(), std::move(makeSure))); _ctx.getThreadingService().master().execute(std::move(task)); @@ -768,10 +768,10 @@ IndexMaintainer::getSchema(void) const } Schema::SP -IndexMaintainer::getActiveFusionWipeTimeSchema(void) const +IndexMaintainer::getActiveFusionPrunedSchema(void) const { LockGuard lock(_index_update_lock); - return _activeFusionWipeTimeSchema; + return _activeFusionPrunedSchema; } TuneFileAttributes @@ -806,7 +806,7 @@ IndexMaintainer::IndexMaintainer(const IndexMaintainerConfig &config, _layout(config.getBaseDir()), _schema(config.getSchema()), _activeFusionSchema(), - _activeFusionWipeTimeSchema(), + _activeFusionPrunedSchema(), _source_selector_changes(0), _selector(), _source_list(), @@ -972,7 +972,7 @@ IndexMaintainer::runFusion(const FusionSpec &fusion_spec) LockGuard slock(_state_lock); LockGuard ilock(_index_update_lock); _activeFusionSchema.reset(new Schema(_schema)); - _activeFusionWipeTimeSchema.reset(); + _activeFusionPrunedSchema.reset(); args._schema = _schema; } FastOS_StatInfo statInfo; @@ -997,15 +997,15 @@ IndexMaintainer::runFusion(const FusionSpec &fusion_spec) LockGuard slock(_state_lock); LockGuard ilock(_index_update_lock); _activeFusionSchema.reset(); - _activeFusionWipeTimeSchema.reset(); + _activeFusionPrunedSchema.reset(); } return fusion_spec.last_fusion_id; } const string new_fusion_dir = getFusionDir(new_fusion_id); - Schema::SP wtSchema = getActiveFusionWipeTimeSchema(); - if (wtSchema.get() != NULL) { - updateDiskIndexSchema(new_fusion_dir, *wtSchema, noSerialNumHigh); + Schema::SP prunedSchema = getActiveFusionPrunedSchema(); + if (prunedSchema) { + updateDiskIndexSchema(new_fusion_dir, *prunedSchema, noSerialNumHigh); } ChangeGens changeGens = getChangeGens(); IDiskIndex::SP new_index(loadDiskIndex(new_fusion_dir)); @@ -1015,7 +1015,7 @@ IndexMaintainer::runFusion(const FusionSpec &fusion_spec) args._new_fusion_id = new_fusion_id; args._changeGens = changeGens; - args._wtSchema = wtSchema; + args._prunedSchema = prunedSchema; for (;;) { // Call reconfig closure for this change Closure0::UP closure( makeClosure(this, &IndexMaintainer::doneFusion, &args, &new_index)); @@ -1024,15 +1024,15 @@ IndexMaintainer::runFusion(const FusionSpec &fusion_spec) break; } changeGens = getChangeGens(); - wtSchema = getActiveFusionWipeTimeSchema(); - if (wtSchema.get() != NULL) { - updateDiskIndexSchema(new_fusion_dir, *wtSchema, noSerialNumHigh); + prunedSchema = getActiveFusionPrunedSchema(); + if (prunedSchema) { + updateDiskIndexSchema(new_fusion_dir, *prunedSchema, noSerialNumHigh); } IDiskIndex::SP diskIndex2; diskIndex2 = reloadDiskIndex(*new_index); new_index = diskIndex2; args._changeGens = changeGens; - args._wtSchema = wtSchema; + args._prunedSchema = prunedSchema; } removeOldDiskIndexes(); @@ -1208,7 +1208,7 @@ IndexMaintainer::pruneRemovedFields(const Schema &schema, SerialNum wipeSerial) ISearchableIndexCollection::SP new_source_list; IIndexCollection::SP coll = getSourceCollection(); updateIndexSchemas(*coll, schema, wipeSerial); - updateActiveFusionWipeTimeSchema(schema); + updateActiveFusionPrunedSchema(schema); { LockGuard state_lock(_state_lock); LockGuard lock(_index_update_lock); diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h index dcedd97abcb..b10ee7cc091 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h @@ -91,7 +91,7 @@ class IndexMaintainer : public IIndexManager, Schema _schema; // Protected by SL + IUL Schema::SP _activeFusionSchema; // Protected by SL + IUL // Protected by SL + IUL - Schema::SP _activeFusionWipeTimeSchema; + Schema::SP _activeFusionPrunedSchema; uint32_t _source_selector_changes; // Protected by IUL // _selector is protected by SL + IUL ISourceSelector::SP _selector; @@ -175,7 +175,7 @@ class IndexMaintainer : public IIndexManager, const Schema &schema, SerialNum wipeSerial); - void updateActiveFusionWipeTimeSchema(const Schema &schema); + void updateActiveFusionPrunedSchema(const Schema &schema); void deactivateDiskIndexes(vespalib::string indexDir); IDiskIndex::SP loadDiskIndex(const vespalib::string &indexDir); IDiskIndex::SP reloadDiskIndex(const IDiskIndex &oldIndex); @@ -208,7 +208,7 @@ class IndexMaintainer : public IIndexManager, // or data structure limitations). FrozenMemoryIndexRefs _extraIndexes; ChangeGens _changeGens; - Schema::SP _wtSchema; + Schema::SP _prunedSchema; FlushArgs(); FlushArgs(const FlushArgs &) = delete; @@ -235,14 +235,14 @@ class IndexMaintainer : public IIndexManager, uint32_t _new_fusion_id; ChangeGens _changeGens; Schema _schema; - Schema::SP _wtSchema; + Schema::SP _prunedSchema; ISearchableIndexCollection::SP _old_source_list; // Delays destruction FusionArgs() : _new_fusion_id(0u), _changeGens(), _schema(), - _wtSchema(), + _prunedSchema(), _old_source_list() { } ~FusionArgs(); @@ -273,7 +273,7 @@ class IndexMaintainer : public IIndexManager, void doneSetSchema(SetSchemaArgs &args, IMemoryIndex::SP &newIndex); Schema getSchema(void) const; - Schema::SP getActiveFusionWipeTimeSchema() const; + Schema::SP getActiveFusionPrunedSchema() const; search::TuneFileAttributes getAttrTune(); ChangeGens getChangeGens(); diff --git a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp index b6aff679921..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()) { @@ -260,31 +260,31 @@ void 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 40368bc8624..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 _hiddenFields; - index::Schema::SP _wipeTimeSchema; + index::Schema::SP _prunedSchema; vespalib::hash_set _indexedDocs; // documents in memory index const uint64_t _staticMemoryFootprint; @@ -164,7 +164,7 @@ public: 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. -- cgit v1.2.3