aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-11-12 21:42:25 +0100
committerGitHub <noreply@github.com>2021-11-12 21:42:25 +0100
commit5cb9b85ffb3ec2a77caaa4ee367ad6435bbf762a (patch)
tree3723c971cf02eadc071c57efd5ac4d13d832220f /searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp
parent3f54f188382c09c409171145cd246b7730db3c6c (diff)
parente834424c31fd2dc6c3268cf3b374c5731108cd6b (diff)
Merge pull request #19988 from vespa-engine/balder/less-eager-compaction-during-retirementv7.500.40
When node is retired we can relax compaction strategy as we have peaked
Diffstat (limited to 'searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp')
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp
index 07bc1c638b5..c7ab83ae590 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp
@@ -206,6 +206,22 @@ FilterAttributeManager::asyncForEachAttribute(std::shared_ptr<IConstAttributeFun
}
void
+FilterAttributeManager::asyncForEachAttribute(std::shared_ptr<IAttributeFunctor> func) const
+{
+ // Run by document db master thread
+ std::vector<AttributeGuard> completeList;
+ _mgr->getAttributeList(completeList);
+ vespalib::ISequencedTaskExecutor &attributeFieldWriter = getAttributeFieldWriter();
+ for (auto &guard : completeList) {
+ search::AttributeVector::SP attrsp = guard.getSP();
+ // Name must be extracted in document db master thread or attribute
+ // writer thread
+ attributeFieldWriter.execute(attributeFieldWriter.getExecutorIdFromName(attrsp->getNamePrefix()),
+ [attrsp, func]() { (*func)(*attrsp); });
+ }
+}
+
+void
FilterAttributeManager::asyncForAttribute(const vespalib::string &name, std::unique_ptr<IAttributeFunctor> func) const {
AttributeGuard::UP attr = _mgr->getAttribute(name);
if (!attr) { return; }