aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp
diff options
context:
space:
mode:
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; }