diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-04-04 22:20:35 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-04-04 22:35:17 +0000 |
commit | 416ff1764ce98954b3b15fcae0f6a50d76b38323 (patch) | |
tree | 8974071929be2d3723db0a14567dcbeb2f7a1797 | |
parent | 130d4607a359ae2740bdeeb0179a731751f979a0 (diff) |
Move sequenced task executors to staging vespalib
72 files changed, 250 insertions, 248 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp index 44ff8cb925e..407b14c5f7d 100644 --- a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/config-attributes.h> #include <vespa/fastos/file.h> -#include <vespa/searchcommon/attribute/attributecontent.h> #include <vespa/searchcommon/attribute/iattributevector.h> #include <vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h> #include <vespa/searchcore/proton/attribute/attribute_manager_initializer.h> @@ -24,18 +23,16 @@ #include <vespa/searchlib/attribute/attribute_read_guard.h> #include <vespa/searchlib/attribute/imported_attribute_vector.h> #include <vespa/searchlib/attribute/imported_attribute_vector_factory.h> -#include <vespa/searchlib/attribute/integerbase.h> #include <vespa/searchlib/attribute/predicate_attribute.h> #include <vespa/searchlib/attribute/reference_attribute.h> #include <vespa/searchlib/attribute/singlenumericattribute.hpp> -#include <vespa/searchlib/common/foregroundtaskexecutor.h> +#include <vespa/vespalib/util/foregroundtaskexecutor.h> #include <vespa/searchlib/common/indexmetainfo.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/predicate/predicate_index.h> #include <vespa/searchlib/predicate/predicate_tree_annotator.h> #include <vespa/searchlib/test/directory_handler.h> #include <vespa/searchlib/test/mock_gid_to_lid_mapping.h> -#include <vespa/searchlib/util/filekit.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/threadstackexecutor.h> @@ -55,7 +52,7 @@ using proton::initializer::InitializerTask; using proton::test::AttributeUtils; using proton::test::createInt32Attribute; using proton::test::Int32Attribute; -using search::ForegroundTaskExecutor; +using vespalib::ForegroundTaskExecutor; using search::TuneFileAttributes; using search::attribute::BasicType; using search::attribute::IAttributeContext; diff --git a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp index 01dc2306ef6..788aa4fb1ee 100644 --- a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp @@ -9,13 +9,14 @@ LOG_SETUP("attribute_populator_test"); #include <vespa/searchcore/proton/attribute/attributemanager.h> #include <vespa/searchcore/proton/common/hw_info.h> #include <vespa/searchcore/proton/test/test.h> -#include <vespa/searchlib/common/foregroundtaskexecutor.h> +#include <vespa/vespalib/util/foregroundtaskexecutor.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/test/directory_handler.h> #include <vespa/vespalib/util/stringfmt.h> using document::config_builder::DocumenttypesConfigBuilderHelper; using document::config_builder::Struct; +using vespalib::ForegroundTaskExecutor; using namespace document; using namespace proton; using namespace search; diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp index edb5a07b059..839ef14fcb0 100644 --- a/searchcore/src/tests/proton/attribute/attribute_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp @@ -26,9 +26,9 @@ #include <vespa/searchlib/attribute/imported_attribute_vector_factory.h> #include <vespa/searchlib/attribute/integerbase.h> #include <vespa/searchlib/attribute/predicate_attribute.h> -#include <vespa/searchlib/common/foregroundtaskexecutor.h> +#include <vespa/vespalib/util/foregroundtaskexecutor.h> #include <vespa/searchlib/common/idestructorcallback.h> -#include <vespa/searchlib/common/sequencedtaskexecutorobserver.h> +#include <vespa/vespalib/util/sequencedtaskexecutorobserver.h> #include <vespa/searchlib/index/docbuilder.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/predicate/predicate_hash.h> @@ -43,8 +43,6 @@ #include <vespa/vespalib/btree/btreeroot.hpp> #include <vespa/searchlib/attribute/singlenumericattribute.hpp> - - #include <vespa/log/log.h> LOG_SETUP("attribute_test"); @@ -76,6 +74,8 @@ using vespalib::eval::ValueType; using vespalib::eval::TensorSpec; using vespalib::tensor::Tensor; using vespalib::tensor::DefaultTensorEngine; +using vespalib::ForegroundTaskExecutor; +using vespalib::SequencedTaskExecutorObserver; using AVConfig = search::attribute::Config; using AVBasicType = search::attribute::BasicType; diff --git a/searchcore/src/tests/proton/attribute/attributeflush_test.cpp b/searchcore/src/tests/proton/attribute/attributeflush_test.cpp index 99d4651d13f..4604129248b 100644 --- a/searchcore/src/tests/proton/attribute/attributeflush_test.cpp +++ b/searchcore/src/tests/proton/attribute/attributeflush_test.cpp @@ -8,7 +8,7 @@ #include <vespa/searchcore/proton/flushengine/shrink_lid_space_flush_target.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/attribute/integerbase.h> -#include <vespa/searchlib/common/foregroundtaskexecutor.h> +#include <vespa/vespalib/util/foregroundtaskexecutor.h> #include <vespa/searchlib/common/indexmetainfo.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/test/directory_handler.h> diff --git a/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp b/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp index 76dcf53c51d..01452f1361e 100644 --- a/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp +++ b/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp @@ -6,7 +6,7 @@ #include <vespa/searchcore/proton/common/hw_info.h> #include <vespa/searchcore/proton/test/attribute_vectors.h> #include <vespa/searchcore/proton/test/attribute_utils.h> -#include <vespa/searchlib/common/foregroundtaskexecutor.h> +#include <vespa/vespalib/util/foregroundtaskexecutor.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/test/directory_handler.h> #include <vespa/vespalib/test/insertion_operators.h> @@ -18,7 +18,7 @@ LOG_SETUP("attributes_state_explorer_test"); using namespace proton; using namespace proton::test; using search::AttributeVector; -using search::ForegroundTaskExecutor; +using vespalib::ForegroundTaskExecutor; using search::TuneFileAttributes; using search::index::DummyFileHeaderContext; using search::test::DirectoryHandler; diff --git a/searchcore/src/tests/proton/attribute/exclusive_attribute_read_accessor/exclusive_attribute_read_accessor_test.cpp b/searchcore/src/tests/proton/attribute/exclusive_attribute_read_accessor/exclusive_attribute_read_accessor_test.cpp index d2eba28bc9b..6f91b1a6f6f 100644 --- a/searchcore/src/tests/proton/attribute/exclusive_attribute_read_accessor/exclusive_attribute_read_accessor_test.cpp +++ b/searchcore/src/tests/proton/attribute/exclusive_attribute_read_accessor/exclusive_attribute_read_accessor_test.cpp @@ -5,7 +5,7 @@ #include <vespa/searchcommon/attribute/config.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/attribute/attributevector.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <vespa/vespalib/util/gate.h> using namespace proton; diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp index 3d1fa25983a..55d524519b8 100644 --- a/searchcore/src/tests/proton/docsummary/docsummary.cpp +++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp @@ -787,7 +787,7 @@ Test::requireThatAttributesAreUsed() TEST_DO(assertTensor(Tensor::UP(), "bj", *rep, 1, rclass)); proton::IAttributeManager::SP attributeManager = dc._ddb->getReadySubDB()->getAttributeManager(); - search::ISequencedTaskExecutor &attributeFieldWriter = attributeManager->getAttributeFieldWriter(); + vespalib::ISequencedTaskExecutor &attributeFieldWriter = attributeManager->getAttributeFieldWriter(); search::AttributeVector *bjAttr = attributeManager->getWritableAttribute("bj"); auto bjTensorAttr = dynamic_cast<search::tensor::TensorAttribute *>(bjAttr); diff --git a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp index 991cb2e519d..7af9d8d816c 100644 --- a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp +++ b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp @@ -4,7 +4,7 @@ #include <vespa/document/fieldvalue/document.h> #include <vespa/document/fieldvalue/fieldvalue.h> #include <vespa/searchlib/common/documentsummary.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <vespa/searchlib/diskindex/diskindex.h> #include <vespa/searchlib/diskindex/fusion.h> #include <vespa/searchlib/diskindex/indexbuilder.h> @@ -149,8 +149,8 @@ void Test::testSearch(Searchable &source, void Test::requireThatMemoryIndexCanBeDumpedAndSearched() { Schema schema = getSchema(); vespalib::ThreadStackExecutor sharedExecutor(2, 0x10000); - auto indexFieldInverter = search::SequencedTaskExecutor::create(2); - auto indexFieldWriter = search::SequencedTaskExecutor::create(2); + auto indexFieldInverter = vespalib::SequencedTaskExecutor::create(2); + auto indexFieldWriter = vespalib::SequencedTaskExecutor::create(2); MemoryIndex memory_index(schema, MockFieldLengthInspector(), *indexFieldInverter, *indexFieldWriter); DocBuilder doc_builder(schema); diff --git a/searchcore/src/tests/proton/index/fusionrunner_test.cpp b/searchcore/src/tests/proton/index/fusionrunner_test.cpp index 975061f9d88..6831dd60bd5 100644 --- a/searchcore/src/tests/proton/index/fusionrunner_test.cpp +++ b/searchcore/src/tests/proton/index/fusionrunner_test.cpp @@ -4,7 +4,7 @@ #include <vespa/searchcore/proton/index/indexmanager.h> #include <vespa/searchcore/proton/server/executorthreadingservice.h> #include <vespa/searchcorespi/index/fusionrunner.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/searchlib/diskindex/diskindex.h> #include <vespa/searchlib/diskindex/indexbuilder.h> #include <vespa/searchlib/fef/matchdatalayout.h> diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp index 8cc075773f7..5b6f7ca9a30 100644 --- a/searchcore/src/tests/proton/index/indexmanager_test.cpp +++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp @@ -7,7 +7,7 @@ #include <vespa/searchcorespi/index/indexcollection.h> #include <vespa/searchcorespi/index/indexflushtarget.h> #include <vespa/searchcorespi/index/indexfusiontarget.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <vespa/searchlib/common/serialnum.h> #include <vespa/searchlib/index/docbuilder.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> @@ -31,7 +31,7 @@ using document::Document; using document::FieldValue; using proton::index::IndexConfig; using proton::index::IndexManager; -using search::SequencedTaskExecutor; +using vespalib::SequencedTaskExecutor; using search::SerialNum; using search::TuneFileAttributes; using search::TuneFileIndexManager; diff --git a/searchcore/src/tests/proton/reference/document_db_reference_resolver/document_db_reference_resolver_test.cpp b/searchcore/src/tests/proton/reference/document_db_reference_resolver/document_db_reference_resolver_test.cpp index 02e9f3e8687..c0098c878b4 100644 --- a/searchcore/src/tests/proton/reference/document_db_reference_resolver/document_db_reference_resolver_test.cpp +++ b/searchcore/src/tests/proton/reference/document_db_reference_resolver/document_db_reference_resolver_test.cpp @@ -19,7 +19,7 @@ #include <vespa/searchlib/attribute/reference_attribute.h> #include <vespa/searchlib/common/i_gid_to_lid_mapper.h> #include <vespa/searchlib/common/i_gid_to_lid_mapper_factory.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <vespa/searchlib/test/mock_attribute_manager.h> #include <vespa/vespalib/test/insertion_operators.h> @@ -33,6 +33,8 @@ using proton::test::MockDocumentDBReference; using search::attribute::test::MockAttributeManager; using vespa::config::search::ImportedFieldsConfig; using vespa::config::search::ImportedFieldsConfigBuilder; +using vespalib::SequencedTaskExecutor; +using vespalib::ISequencedTaskExecutor; const ReferenceAttribute *getReferenceAttribute(const IGidToLidChangeListener &listener) { auto mylistener = dynamic_cast<const GidToLidChangeListener *>(&listener); diff --git a/searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp b/searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp index a023ff175d6..2fb439ea530 100644 --- a/searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp +++ b/searchcore/src/tests/proton/reference/gid_to_lid_change_listener/gid_to_lid_change_listener_test.cpp @@ -2,7 +2,7 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/stllike/string.h> #include <vespa/document/base/documentid.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <vespa/searchcore/proton/common/monitored_refcount.h> #include <vespa/searchcore/proton/reference/gid_to_lid_change_listener.h> #include <vespa/searchlib/common/i_gid_to_lid_mapper_factory.h> @@ -49,13 +49,13 @@ struct MyGidToLidMapperFactory : public MockGidToLidMapperFactory struct Fixture { std::shared_ptr<ReferenceAttribute> _attr; - std::unique_ptr<search::ISequencedTaskExecutor> _writer; + std::unique_ptr<vespalib::ISequencedTaskExecutor> _writer; MonitoredRefCount _refCount; std::unique_ptr<GidToLidChangeListener> _listener; Fixture() : _attr(std::make_shared<ReferenceAttribute>("test", Config(BasicType::REFERENCE))), - _writer(search::SequencedTaskExecutor::create(1)), + _writer(vespalib::SequencedTaskExecutor::create(1)), _refCount(), _listener() { diff --git a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp index 95cbdafb8e4..898825016b3 100644 --- a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp +++ b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp @@ -11,7 +11,7 @@ #include <vespa/searchcore/proton/reprocessing/i_reprocessing_handler.h> #include <vespa/searchcore/proton/test/attribute_utils.h> #include <vespa/searchlib/attribute/attributefactory.h> -#include <vespa/searchlib/common/foregroundtaskexecutor.h> +#include <vespa/vespalib/util/foregroundtaskexecutor.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/test/directory_handler.h> #include <vespa/vespalib/gtest/gtest.h> @@ -29,6 +29,7 @@ using search::attribute::BasicType; using search::attribute::Config; using search::index::schema::DataType; using search::test::DirectoryHandler; +using vespalib::ForegroundTaskExecutor; const vespalib::string TEST_DIR = "test_output"; const SerialNum INIT_SERIAL_NUM = 10; @@ -41,10 +42,10 @@ struct MyReprocessingHandler : public IReprocessingHandler IReprocessingReader::SP _reader; std::vector<IReprocessingRewriter::SP> _rewriters; MyReprocessingHandler() : _reader(), _rewriters() {} - virtual void addReader(const IReprocessingReader::SP &reader) override { + void addReader(const IReprocessingReader::SP &reader) override { _reader = reader; } - virtual void addRewriter(const IReprocessingRewriter::SP &rewriter) override { + void addRewriter(const IReprocessingRewriter::SP &rewriter) override { _rewriters.push_back(rewriter); } }; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp index f1035776a8f..33b9d162163 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp @@ -13,7 +13,6 @@ #include <vespa/searchlib/attribute/attributevector.hpp> #include <vespa/searchlib/attribute/imported_attribute_vector.h> #include <vespa/searchlib/common/idestructorcallback.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> #include <vespa/vespalib/stllike/hash_map.hpp> #include <vespa/log/log.h> @@ -22,7 +21,8 @@ LOG_SETUP(".proton.attribute.attribute_writer"); using namespace document; using namespace search; using search::attribute::ImportedAttributeVector; -using ExecutorId = search::ISequencedTaskExecutor::ExecutorId; +using vespalib::ISequencedTaskExecutor; +using ExecutorId = vespalib::ISequencedTaskExecutor::ExecutorId; namespace proton { diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.h b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.h index 8c9b756cd89..4a9726dd113 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.h @@ -5,7 +5,7 @@ #include "i_attribute_writer.h" #include <vespa/searchcore/proton/common/commit_time_tracker.h> #include <vespa/document/base/fieldpath.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/vespalib/stllike/hash_map.h> namespace document { class DocumentType; } @@ -25,8 +25,8 @@ private: typedef document::DocumentType DocumentType; typedef document::FieldValue FieldValue; const IAttributeManager::SP _mgr; - search::ISequencedTaskExecutor &_attributeFieldWriter; - using ExecutorId = search::ISequencedTaskExecutor::ExecutorId; + vespalib::ISequencedTaskExecutor &_attributeFieldWriter; + using ExecutorId = vespalib::ISequencedTaskExecutor::ExecutorId; public: class WriteField { diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp index 02bf4f4d7cc..5ff40fa5360 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp @@ -14,7 +14,7 @@ #include <vespa/searchlib/attribute/imported_attribute_vector.h> #include <vespa/searchcommon/attribute/i_attribute_functor.h> #include <vespa/searchlib/attribute/interlock.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/searchlib/common/threaded_compactable_lid_space.h> #include <vespa/searchlib/attribute/attributevector.h> #include <vespa/vespalib/io/fileutil.h> @@ -74,7 +74,7 @@ search::SerialNum estimateShrinkSerialNum(const AttributeVector &attr) return std::max(attr.getStatus().getLastSyncToken(), serialNum); } -std::shared_ptr<ShrinkLidSpaceFlushTarget> allocShrinker(const AttributeVector::SP &attr, search::ISequencedTaskExecutor &attributeFieldWriter, AttributeDiskLayout &diskLayout) +std::shared_ptr<ShrinkLidSpaceFlushTarget> allocShrinker(const AttributeVector::SP &attr, vespalib::ISequencedTaskExecutor &attributeFieldWriter, AttributeDiskLayout &diskLayout) { using Type = IFlushTarget::Type; using Component = IFlushTarget::Component; @@ -238,8 +238,7 @@ AttributeManager::AttributeManager(const vespalib::string &baseDir, const vespalib::string &documentSubDbName, const TuneFileAttributes &tuneFileAttributes, const FileHeaderContext &fileHeaderContext, - search::ISequencedTaskExecutor & - attributeFieldWriter, + vespalib::ISequencedTaskExecutor &attributeFieldWriter, const HwInfo &hwInfo) : proton::IAttributeManager(), _attributes(), @@ -262,8 +261,7 @@ AttributeManager::AttributeManager(const vespalib::string &baseDir, const vespalib::string &documentSubDbName, const search::TuneFileAttributes &tuneFileAttributes, const search::common::FileHeaderContext &fileHeaderContext, - search::ISequencedTaskExecutor & - attributeFieldWriter, + vespalib::ISequencedTaskExecutor &attributeFieldWriter, const IAttributeFactory::SP &factory, const HwInfo &hwInfo) : proton::IAttributeManager(), @@ -548,7 +546,7 @@ AttributeManager::pruneRemovedFields(search::SerialNum serialNum) } } -search::ISequencedTaskExecutor & +vespalib::ISequencedTaskExecutor & AttributeManager::getAttributeFieldWriter() const { return _attributeFieldWriter; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h index 881452c6b3d..350b986add4 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h @@ -77,7 +77,7 @@ private: const search::common::FileHeaderContext &_fileHeaderContext; IAttributeFactory::SP _factory; std::shared_ptr<search::attribute::Interlock> _interlock; - search::ISequencedTaskExecutor &_attributeFieldWriter; + vespalib::ISequencedTaskExecutor &_attributeFieldWriter; HwInfo _hwInfo; std::unique_ptr<ImportedAttributesRepo> _importedAttributes; @@ -103,14 +103,14 @@ public: const vespalib::string &documentSubDbName, const search::TuneFileAttributes &tuneFileAttributes, const search::common::FileHeaderContext & fileHeaderContext, - search::ISequencedTaskExecutor &attributeFieldWriter, + vespalib::ISequencedTaskExecutor &attributeFieldWriter, const HwInfo &hwInfo); AttributeManager(const vespalib::string &baseDir, const vespalib::string &documentSubDbName, const search::TuneFileAttributes &tuneFileAttributes, const search::common::FileHeaderContext & fileHeaderContext, - search::ISequencedTaskExecutor &attributeFieldWriter, + vespalib::ISequencedTaskExecutor &attributeFieldWriter, const IAttributeFactory::SP &factory, const HwInfo &hwInfo); @@ -164,7 +164,7 @@ public: const IAttributeFactory::SP &getFactory() const override { return _factory; } - search::ISequencedTaskExecutor &getAttributeFieldWriter() const override; + vespalib::ISequencedTaskExecutor &getAttributeFieldWriter() const override; search::AttributeVector *getWritableAttribute(const vespalib::string &name) const override; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp index 7a31580fb16..9543897407d 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp @@ -3,12 +3,12 @@ #include "exclusive_attribute_read_accessor.h" #include <vespa/vespalib/util/gate.h> #include <vespa/searchlib/attribute/attributevector.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> namespace proton { using search::AttributeVector; -using search::ISequencedTaskExecutor; +using vespalib::ISequencedTaskExecutor; using vespalib::Executor; using vespalib::Gate; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h index 00f3ad3e8ac..233d42b2194 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h @@ -6,9 +6,11 @@ namespace search { class AttributeVector; +} +namespace vespalib { + class Gate; class ISequencedTaskExecutor; } -namespace vespalib { class Gate; } namespace proton { @@ -38,13 +40,13 @@ public: private: using AttributeVectorSP = std::shared_ptr<search::AttributeVector>; AttributeVectorSP _attribute; - search::ISequencedTaskExecutor &_attributeFieldWriter; + vespalib::ISequencedTaskExecutor &_attributeFieldWriter; public: using UP = std::unique_ptr<ExclusiveAttributeReadAccessor>; ExclusiveAttributeReadAccessor(const AttributeVectorSP &attribute, - search::ISequencedTaskExecutor &attributeFieldWriter); + vespalib::ISequencedTaskExecutor &attributeFieldWriter); Guard::UP takeGuard(); }; 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 aee68457b62..0fd9849443a 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "filter_attribute_manager.h" -#include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/searchlib/attribute/attributevector.h> #include <vespa/searchcommon/attribute/i_attribute_functor.h> @@ -161,7 +161,7 @@ FilterAttributeManager::getFlushedSerialNum(const vespalib::string &name) const } -search::ISequencedTaskExecutor & +vespalib::ISequencedTaskExecutor & FilterAttributeManager::getAttributeFieldWriter() const { return _mgr->getAttributeFieldWriter(); @@ -190,7 +190,7 @@ FilterAttributeManager::asyncForEachAttribute(std::shared_ptr<IConstAttributeFun // Run by document db master thread std::vector<AttributeGuard> completeList; _mgr->getAttributeList(completeList); - search::ISequencedTaskExecutor &attributeFieldWriter = getAttributeFieldWriter(); + 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 @@ -204,7 +204,7 @@ void FilterAttributeManager::asyncForAttribute(const vespalib::string &name, std::unique_ptr<IAttributeFunctor> func) const { AttributeGuard::UP attr = _mgr->getAttribute(name); if (!attr) { return; } - search::ISequencedTaskExecutor &attributeFieldWriter = getAttributeFieldWriter(); + vespalib::ISequencedTaskExecutor &attributeFieldWriter = getAttributeFieldWriter(); vespalib::string attrName = (*attr)->getNamePrefix(); attributeFieldWriter.execute(attributeFieldWriter.getExecutorId(attrName), [attr=std::move(attr), func=std::move(func)]() mutable { diff --git a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.h b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.h index 0bd04b8f0a5..3755946037d 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.h @@ -46,7 +46,7 @@ public: void getAttributeListAll(std::vector<search::AttributeGuard> &) const override; void pruneRemovedFields(search::SerialNum serialNum) override; const IAttributeFactory::SP &getFactory() const override; - search::ISequencedTaskExecutor & getAttributeFieldWriter() const override; + vespalib::ISequencedTaskExecutor & getAttributeFieldWriter() const override; search::AttributeVector * getWritableAttribute(const vespalib::string &name) const override; const std::vector<search::AttributeVector *> & getWritableAttributes() const override; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/flushableattribute.cpp b/searchcore/src/vespa/searchcore/proton/attribute/flushableattribute.cpp index ee1c06ef7c1..0a61ec8d882 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/flushableattribute.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/flushableattribute.cpp @@ -10,9 +10,9 @@ #include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/util/closuretask.h> #include <vespa/searchlib/common/serialnumfileheadercontext.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> #include <vespa/searchlib/attribute/attributememorysavetarget.h> #include <vespa/searchlib/attribute/attributevector.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/vespalib/util/stringfmt.h> #include <fstream> #include <future> @@ -154,7 +154,7 @@ FlushableAttribute::FlushableAttribute(const AttributeVectorSP attr, tuneFileAttributes, const FileHeaderContext & fileHeaderContext, - search::ISequencedTaskExecutor & + vespalib::ISequencedTaskExecutor & attributeFieldWriter, const HwInfo &hwInfo) : IFlushTarget(make_string("attribute.flush.%s", attr->getName().c_str()), Type::SYNC, Component::ATTRIBUTE), diff --git a/searchcore/src/vespa/searchcore/proton/attribute/flushableattribute.h b/searchcore/src/vespa/searchcore/proton/attribute/flushableattribute.h index 01178dbe86c..8d807c153c0 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/flushableattribute.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/flushableattribute.h @@ -7,14 +7,10 @@ #include <vespa/searchcore/proton/common/hw_info.h> -namespace search { +namespace search { class AttributeVector; } -class ISequencedTaskExecutor; -class AttributeVector; - -namespace common { class FileHeaderContext; } - -} +namespace search::common { class FileHeaderContext; } +namespace vespalib { class ISequencedTaskExecutor; } namespace proton { @@ -39,7 +35,7 @@ private: FlushStats _lastStats; const search::TuneFileAttributes _tuneFileAttributes; const search::common::FileHeaderContext &_fileHeaderContext; - search::ISequencedTaskExecutor &_attributeFieldWriter; + vespalib::ISequencedTaskExecutor &_attributeFieldWriter; HwInfo _hwInfo; std::shared_ptr<AttributeDirectory> _attrDir; @@ -59,7 +55,7 @@ public: const search::TuneFileAttributes &tuneFileAttributes, const search::common::FileHeaderContext & fileHeaderContext, - search::ISequencedTaskExecutor &attributeFieldWriter, + vespalib::ISequencedTaskExecutor &attributeFieldWriter, const HwInfo &hwInfo); virtual diff --git a/searchcore/src/vespa/searchcore/proton/attribute/i_attribute_manager.h b/searchcore/src/vespa/searchcore/proton/attribute/i_attribute_manager.h index 4e50c52c58b..25d0a508438 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/i_attribute_manager.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/i_attribute_manager.h @@ -10,12 +10,12 @@ #include <vespa/searchlib/attribute/iattributemanager.h> #include <vespa/searchlib/common/serialnum.h> -namespace search { - class IDestructorCallback; - class ISequencedTaskExecutor; -} +namespace search { class IDestructorCallback;} + namespace search::attribute { class IAttributeFunctor; } +namespace vespalib { class ISequencedTaskExecutor; } + namespace proton { class ImportedAttributesRepo; @@ -72,7 +72,7 @@ struct IAttributeManager : public search::IAttributeManager */ virtual const IAttributeFactory::SP &getFactory() const = 0; - virtual search::ISequencedTaskExecutor &getAttributeFieldWriter() const = 0; + virtual vespalib::ISequencedTaskExecutor &getAttributeFieldWriter() const = 0; /* * Get pointer to named writable attribute. If attribute isn't diff --git a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp index 7f2ac5db768..fa531385d52 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.cpp @@ -28,7 +28,7 @@ using search::AttributeGuard; using search::AttributeVector; using search::IAttributeManager; using search::NotImplementedAttribute; -using search::ISequencedTaskExecutor; +using vespalib::ISequencedTaskExecutor; using vespa::config::search::ImportedFieldsConfig; namespace proton { diff --git a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.h b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.h index 6ac804f538a..03d6a64345c 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.h +++ b/searchcore/src/vespa/searchcore/proton/reference/document_db_reference_resolver.h @@ -6,11 +6,23 @@ #include <vespa/searchlib/attribute/not_implemented_attribute.h> #include <map> -namespace document { class DocumentType; class DocumentTypeRepo; } -namespace search { class ISequencedTaskExecutor; class IAttributeManager; struct IDocumentMetaStoreContext; - namespace attribute { class IAttributeVector; class ReferenceAttribute; } } -namespace vespa { namespace config { namespace search { namespace internal { class InternalImportedFieldsType; } } } } +namespace document { + class DocumentType; + class DocumentTypeRepo; +} +namespace search { + class IAttributeManager; + struct IDocumentMetaStoreContext; +} +namespace search::attribute { + class IAttributeVector; + class ReferenceAttribute; +} +namespace vespa::config::search::internal { class InternalImportedFieldsType; } +namespace vespalib { + class ISequencedTaskExecutor; +} namespace proton { class IDocumentDBReference; @@ -27,12 +39,12 @@ class DocumentDBReferenceResolver : public IDocumentDBReferenceResolver { private: using ImportedFieldsConfig = const vespa::config::search::internal::InternalImportedFieldsType; const IDocumentDBReferenceRegistry &_registry; - const document::DocumentType &_thisDocType; - const ImportedFieldsConfig &_importedFieldsCfg; - const document::DocumentType &_prevThisDocType; - MonitoredRefCount &_refCount; - search::ISequencedTaskExecutor &_attributeFieldWriter; - bool _useReferences; + const document::DocumentType &_thisDocType; + const ImportedFieldsConfig &_importedFieldsCfg; + const document::DocumentType &_prevThisDocType; + MonitoredRefCount &_refCount; + vespalib::ISequencedTaskExecutor &_attributeFieldWriter; + bool _useReferences; std::map<vespalib::string, std::unique_ptr<GidToLidChangeRegistrator>> _registrators; GidToLidChangeRegistrator &getRegistrator(const vespalib::string &docTypeName); @@ -50,7 +62,7 @@ public: const ImportedFieldsConfig &importedFieldsCfg, const document::DocumentType &prevThisDocType, MonitoredRefCount &refCount, - search::ISequencedTaskExecutor &attributeFieldWriter, + vespalib::ISequencedTaskExecutor &attributeFieldWriter, bool useReferences); ~DocumentDBReferenceResolver() override; diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.cpp b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.cpp index 46096fead05..7d5eabe7de8 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.cpp +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.cpp @@ -3,10 +3,9 @@ #include "gid_to_lid_change_listener.h" #include <future> - namespace proton { -GidToLidChangeListener::GidToLidChangeListener(search::ISequencedTaskExecutor &attributeFieldWriter, +GidToLidChangeListener::GidToLidChangeListener(vespalib::ISequencedTaskExecutor &attributeFieldWriter, std::shared_ptr<search::attribute::ReferenceAttribute> attr, MonitoredRefCount &refCount, const vespalib::string &name, diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.h b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.h index d4c349bd1d7..7b033b9899f 100644 --- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.h +++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_listener.h @@ -4,7 +4,7 @@ #include "i_gid_to_lid_change_listener.h" #include <vespa/searchlib/attribute/reference_attribute.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <vespa/searchcore/proton/common/monitored_refcount.h> namespace proton { @@ -15,25 +15,25 @@ namespace proton { */ class GidToLidChangeListener : public IGidToLidChangeListener { - search::ISequencedTaskExecutor &_attributeFieldWriter; - search::ISequencedTaskExecutor::ExecutorId _executorId; + vespalib::ISequencedTaskExecutor &_attributeFieldWriter; + vespalib::ISequencedTaskExecutor::ExecutorId _executorId; std::shared_ptr<search::attribute::ReferenceAttribute> _attr; MonitoredRefCount &_refCount; vespalib::string _name; vespalib::string _docTypeName; public: - GidToLidChangeListener(search::ISequencedTaskExecutor &attributeFieldWriter, + GidToLidChangeListener(vespalib::ISequencedTaskExecutor &attributeFieldWriter, std::shared_ptr<search::attribute::ReferenceAttribute> attr, MonitoredRefCount &refCount, const vespalib::string &name, const vespalib::string &docTypeName); - virtual ~GidToLidChangeListener(); - virtual void notifyPutDone(document::GlobalId gid, uint32_t lid) override; - virtual void notifyRemove(document::GlobalId gid) override; - virtual void notifyRegistered() override; - virtual const vespalib::string &getName() const override; - virtual const vespalib::string &getDocTypeName() const override; + ~GidToLidChangeListener() override; + void notifyPutDone(document::GlobalId gid, uint32_t lid) override; + void notifyRemove(document::GlobalId gid) override; + void notifyRegistered() override; + const vespalib::string &getName() const override; + const vespalib::string &getDocTypeName() const override; const std::shared_ptr<search::attribute::ReferenceAttribute> &getReferenceAttribute() const { return _attr; } }; diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp index a725b00d485..e3657eefdc8 100644 --- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp @@ -2,7 +2,7 @@ #include "executorthreadingservice.h" #include <vespa/searchcore/proton/metrics/executor_threading_service_stats.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <vespa/vespalib/util/singleexecutor.h> #include <vespa/vespalib/util/blockingthreadstackexecutor.h> @@ -10,7 +10,7 @@ using vespalib::SyncableThreadExecutor; using vespalib::BlockingThreadStackExecutor; using vespalib::SingleExecutor; -using search::SequencedTaskExecutor; +using vespalib::SequencedTaskExecutor; using OptimizeFor = vespalib::Executor::OptimizeFor; namespace proton { @@ -101,17 +101,17 @@ ExecutorThreadingService::getStats() _attributeFieldWriter->getStats()); } -search::ISequencedTaskExecutor & +vespalib::ISequencedTaskExecutor & ExecutorThreadingService::indexFieldInverter() { return *_indexFieldInverter; } -search::ISequencedTaskExecutor & +vespalib::ISequencedTaskExecutor & ExecutorThreadingService::indexFieldWriter() { return *_indexFieldWriter; } -search::ISequencedTaskExecutor & +vespalib::ISequencedTaskExecutor & ExecutorThreadingService::attributeFieldWriter() { return *_attributeFieldWriter; } diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h index 4d018e2b6f3..dc446a202ec 100644 --- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h +++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h @@ -16,16 +16,16 @@ class ExecutorThreadingServiceStats; class ExecutorThreadingService : public searchcorespi::index::IThreadingService { private: - vespalib::SyncableThreadExecutor & _sharedExecutor; - vespalib::ThreadStackExecutor _masterExecutor; - std::unique_ptr<vespalib::SyncableThreadExecutor> _indexExecutor; - std::unique_ptr<vespalib::SyncableThreadExecutor> _summaryExecutor; - ExecutorThreadService _masterService; - ExecutorThreadService _indexService; - ExecutorThreadService _summaryService; - std::unique_ptr<search::ISequencedTaskExecutor> _indexFieldInverter; - std::unique_ptr<search::ISequencedTaskExecutor> _indexFieldWriter; - std::unique_ptr<search::ISequencedTaskExecutor> _attributeFieldWriter; + vespalib::SyncableThreadExecutor & _sharedExecutor; + vespalib::ThreadStackExecutor _masterExecutor; + std::unique_ptr<vespalib::SyncableThreadExecutor> _indexExecutor; + std::unique_ptr<vespalib::SyncableThreadExecutor> _summaryExecutor; + ExecutorThreadService _masterService; + ExecutorThreadService _indexService; + ExecutorThreadService _summaryService; + std::unique_ptr<vespalib::ISequencedTaskExecutor> _indexFieldInverter; + std::unique_ptr<vespalib::ISequencedTaskExecutor> _indexFieldWriter; + std::unique_ptr<vespalib::ISequencedTaskExecutor> _attributeFieldWriter; public: using OptimizeFor = vespalib::Executor::OptimizeFor; @@ -79,9 +79,9 @@ public: return _sharedExecutor; } - search::ISequencedTaskExecutor &indexFieldInverter() override; - search::ISequencedTaskExecutor &indexFieldWriter() override; - search::ISequencedTaskExecutor &attributeFieldWriter() override; + vespalib::ISequencedTaskExecutor &indexFieldInverter() override; + vespalib::ISequencedTaskExecutor &indexFieldWriter() override; + vespalib::ISequencedTaskExecutor &attributeFieldWriter() override; ExecutorThreadingServiceStats getStats(); }; diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp b/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp index dfe98b44adc..c24790a61f4 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp @@ -6,7 +6,7 @@ #include "removedonecontext.h" #include "putdonecontext.h" #include <vespa/searchcore/proton/feedoperation/operations.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> using document::Document; using document::DocumentUpdate; diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp index eab118c1188..e0d873152cd 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp @@ -4,13 +4,9 @@ #include "forcecommitcontext.h" #include "operationdonecontext.h" #include "removedonecontext.h" -#include <vespa/searchcore/proton/common/feedtoken.h> #include <vespa/searchcore/proton/documentmetastore/ilidreusedelayer.h> #include <vespa/searchcore/proton/feedoperation/compact_lid_space_operation.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> -#include <vespa/vespalib/text/stringtokenizer.h> -#include <vespa/vespalib/util/closuretask.h> -#include <vespa/vespalib/util/exceptions.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/log/log.h> LOG_SETUP(".proton.server.searchable_feed_view"); @@ -23,8 +19,6 @@ using document::DocumentUpdate; using search::index::Schema; using storage::spi::BucketInfoResult; using storage::spi::Timestamp; -using vespalib::IllegalStateException; -using vespalib::make_string; using vespalib::makeLambdaTask; namespace proton { diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp index 6397195da93..a6695f6318d 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp @@ -18,7 +18,7 @@ #include <vespa/searchcore/proton/documentmetastore/ilidreusedelayer.h> #include <vespa/searchcore/proton/feedoperation/operations.h> #include <vespa/searchcore/proton/reference/i_gid_to_lid_change_handler.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/log/log.h> diff --git a/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp b/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp index 58000348ecf..1281785e898 100644 --- a/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "visibilityhandler.h" -#include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/vespalib/util/closuretask.h> using vespalib::makeTask; diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h b/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h index 57c86855217..3e49bb449ff 100644 --- a/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h +++ b/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h @@ -55,7 +55,7 @@ public: const IAttributeFactory::SP &getFactory() const override { HDR_ABORT("should not be reached"); } - search::ISequencedTaskExecutor &getAttributeFieldWriter() const override { + vespalib::ISequencedTaskExecutor &getAttributeFieldWriter() const override { HDR_ABORT("should not be reached"); } search::AttributeVector *getWritableAttribute(const vespalib::string &) const override { diff --git a/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h b/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h index 23c62d179b1..7f6e7b40635 100644 --- a/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h +++ b/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h @@ -4,7 +4,7 @@ #include "executor_observer.h" #include "thread_service_observer.h" #include <vespa/searchcorespi/index/ithreadingservice.h> -#include <vespa/searchlib/common/sequencedtaskexecutorobserver.h> +#include <vespa/vespalib/util/sequencedtaskexecutorobserver.h> namespace proton:: test { @@ -16,9 +16,9 @@ private: ThreadServiceObserver _index; ThreadServiceObserver _summary; vespalib::ThreadExecutor & _shared; - search::SequencedTaskExecutorObserver _indexFieldInverter; - search::SequencedTaskExecutorObserver _indexFieldWriter; - search::SequencedTaskExecutorObserver _attributeFieldWriter; + vespalib::SequencedTaskExecutorObserver _indexFieldInverter; + vespalib::SequencedTaskExecutorObserver _indexFieldWriter; + vespalib::SequencedTaskExecutorObserver _attributeFieldWriter; public: ThreadingServiceObserver(searchcorespi::index::IThreadingService &service); @@ -32,14 +32,14 @@ public: const ThreadServiceObserver &summaryObserver() const { return _summary; } - const search::SequencedTaskExecutorObserver &indexFieldInverterObserver() const { + const vespalib::SequencedTaskExecutorObserver &indexFieldInverterObserver() const { return _indexFieldInverter; } - const search::SequencedTaskExecutorObserver &indexFieldWriterObserver() const { + const vespalib::SequencedTaskExecutorObserver &indexFieldWriterObserver() const { return _indexFieldWriter; } - const search::SequencedTaskExecutorObserver &attributeFieldWriterObserver() const { + const vespalib::SequencedTaskExecutorObserver &attributeFieldWriterObserver() const { return _attributeFieldWriter; } @@ -59,14 +59,14 @@ public: vespalib::ThreadExecutor &shared() override { return _shared; } - search::ISequencedTaskExecutor &indexFieldInverter() override { + vespalib::ISequencedTaskExecutor &indexFieldInverter() override { return _indexFieldInverter; } - search::ISequencedTaskExecutor &indexFieldWriter() override { + vespalib::ISequencedTaskExecutor &indexFieldWriter() override { return _indexFieldWriter; } - search::ISequencedTaskExecutor &attributeFieldWriter() override { + vespalib::ISequencedTaskExecutor &attributeFieldWriter() override { return _attributeFieldWriter; } diff --git a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h index eb80eff19ac..2ace9a8ac6b 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h +++ b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h @@ -4,7 +4,7 @@ #include "i_thread_service.h" #include <vespa/vespalib/util/syncable.h> -namespace search { class ISequencedTaskExecutor; } +namespace vespalib { class ISequencedTaskExecutor; } namespace searchcorespi::index { /** @@ -55,9 +55,9 @@ struct IThreadingService : public vespalib::Syncable virtual IThreadService &index() = 0; virtual IThreadService &summary() = 0; virtual vespalib::ThreadExecutor &shared() = 0; - virtual search::ISequencedTaskExecutor &indexFieldInverter() = 0; - virtual search::ISequencedTaskExecutor &indexFieldWriter() = 0; - virtual search::ISequencedTaskExecutor &attributeFieldWriter() = 0; + virtual vespalib::ISequencedTaskExecutor &indexFieldInverter() = 0; + virtual vespalib::ISequencedTaskExecutor &indexFieldWriter() = 0; + virtual vespalib::ISequencedTaskExecutor &attributeFieldWriter() = 0; }; } diff --git a/searchlib/CMakeLists.txt b/searchlib/CMakeLists.txt index a76baeced04..4237bede9d5 100644 --- a/searchlib/CMakeLists.txt +++ b/searchlib/CMakeLists.txt @@ -100,11 +100,9 @@ vespa_define_module( src/tests/bitvector src/tests/bytecomplens src/tests/common/bitvector - src/tests/common/foregroundtaskexecutor src/tests/common/location src/tests/common/matching_elements src/tests/common/resultset - src/tests/common/sequencedtaskexecutor src/tests/common/struct_field_mapper src/tests/common/summaryfeatures src/tests/diskindex/bitvector diff --git a/searchlib/src/apps/tests/memoryindexstress_test.cpp b/searchlib/src/apps/tests/memoryindexstress_test.cpp index dc950b84508..6bbd93bda84 100644 --- a/searchlib/src/apps/tests/memoryindexstress_test.cpp +++ b/searchlib/src/apps/tests/memoryindexstress_test.cpp @@ -9,7 +9,6 @@ #include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/repo/fixedtyperepo.h> #include <vespa/searchlib/common/scheduletaskcallback.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> #include <vespa/searchlib/fef/matchdata.h> #include <vespa/searchlib/fef/matchdatalayout.h> #include <vespa/searchlib/fef/termfieldmatchdata.h> @@ -24,6 +23,7 @@ #include <vespa/searchlib/util/rand48.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/threadstackexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <vespa/log/log.h> LOG_SETUP("memoryindexstress_test"); @@ -195,8 +195,8 @@ struct Fixture { Schema schema; DocumentTypeRepo repo; vespalib::ThreadStackExecutor _executor; - std::unique_ptr<search::ISequencedTaskExecutor> _invertThreads; - std::unique_ptr<search::ISequencedTaskExecutor> _pushThreads; + std::unique_ptr<vespalib::ISequencedTaskExecutor> _invertThreads; + std::unique_ptr<vespalib::ISequencedTaskExecutor> _pushThreads; MemoryIndex index; uint32_t _readThreads; vespalib::ThreadStackExecutor _writer; // 1 write thread @@ -247,8 +247,8 @@ Fixture::Fixture(uint32_t readThreads) : schema(makeSchema()), repo(makeDocTypeRepoConfig()), _executor(1, 128 * 1024), - _invertThreads(search::SequencedTaskExecutor::create(2)), - _pushThreads(search::SequencedTaskExecutor::create(2)), + _invertThreads(vespalib::SequencedTaskExecutor::create(2)), + _pushThreads(vespalib::SequencedTaskExecutor::create(2)), index(schema, MockFieldLengthInspector(), *_invertThreads, *_pushThreads), _readThreads(readThreads), _writer(1, 128 * 1024), diff --git a/searchlib/src/tests/common/foregroundtaskexecutor/.gitignore b/searchlib/src/tests/common/foregroundtaskexecutor/.gitignore deleted file mode 100644 index 0bd7759156b..00000000000 --- a/searchlib/src/tests/common/foregroundtaskexecutor/.gitignore +++ /dev/null @@ -1 +0,0 @@ -searchlib_foregroundtaskexecutor_test_app diff --git a/searchlib/src/tests/common/foregroundtaskexecutor/CMakeLists.txt b/searchlib/src/tests/common/foregroundtaskexecutor/CMakeLists.txt deleted file mode 100644 index 64354d54396..00000000000 --- a/searchlib/src/tests/common/foregroundtaskexecutor/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(searchlib_foregroundtaskexecutor_test_app TEST - SOURCES - foregroundtaskexecutor_test.cpp - DEPENDS - searchlib -) -vespa_add_test(NAME searchlib_foregroundtaskexecutor_test_app COMMAND searchlib_foregroundtaskexecutor_test_app) diff --git a/searchlib/src/tests/common/sequencedtaskexecutor/.gitignore b/searchlib/src/tests/common/sequencedtaskexecutor/.gitignore deleted file mode 100644 index 4bd94f124fb..00000000000 --- a/searchlib/src/tests/common/sequencedtaskexecutor/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -searchlib_sequencedtaskexecutor_test_app -searchlib_sequencedtaskexecutor_benchmark_app diff --git a/searchlib/src/tests/common/sequencedtaskexecutor/CMakeLists.txt b/searchlib/src/tests/common/sequencedtaskexecutor/CMakeLists.txt deleted file mode 100644 index fd6cd9efc43..00000000000 --- a/searchlib/src/tests/common/sequencedtaskexecutor/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(searchlib_sequencedtaskexecutor_benchmark_app TEST - SOURCES - sequencedtaskexecutor_benchmark.cpp - DEPENDS - searchlib -) - -vespa_add_executable(searchlib_sequencedtaskexecutor_test_app TEST - SOURCES - sequencedtaskexecutor_test.cpp - DEPENDS - searchlib -) -vespa_add_test(NAME searchlib_sequencedtaskexecutor_test_app COMMAND searchlib_sequencedtaskexecutor_test_app) - -vespa_add_executable(searchlib_adaptive_sequenced_executor_test_app TEST - SOURCES - adaptive_sequenced_executor_test.cpp - DEPENDS - searchlib -) -vespa_add_test(NAME searchlib_adaptive_sequenced_executor_test_app COMMAND searchlib_adaptive_sequenced_executor_test_app) diff --git a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp index 92d0659d984..c2fd048ce3e 100644 --- a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp +++ b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp @@ -1,6 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/searchlib/common/sequencedtaskexecutor.h> #include <vespa/searchlib/diskindex/diskindex.h> #include <vespa/searchlib/diskindex/fusion.h> #include <vespa/searchlib/diskindex/indexbuilder.h> @@ -19,6 +18,7 @@ #include <vespa/vespalib/btree/btreeroot.hpp> #include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/util/threadstackexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <gtest/gtest.h> #include <vespa/log/log.h> @@ -37,6 +37,7 @@ using search::common::FileHeaderContext; using search::index::schema::CollectionType; using search::index::schema::DataType; using search::index::test::MockFieldLengthInspector; +using vespalib::SequencedTaskExecutor; using namespace index; diff --git a/searchlib/src/tests/memoryindex/document_inverter/document_inverter_test.cpp b/searchlib/src/tests/memoryindex/document_inverter/document_inverter_test.cpp index 60b21699406..58f800dec23 100644 --- a/searchlib/src/tests/memoryindex/document_inverter/document_inverter_test.cpp +++ b/searchlib/src/tests/memoryindex/document_inverter/document_inverter_test.cpp @@ -1,6 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/searchlib/common/sequencedtaskexecutor.h> #include <vespa/searchlib/index/docbuilder.h> #include <vespa/searchlib/index/field_length_calculator.h> #include <vespa/searchlib/memoryindex/document_inverter.h> @@ -9,6 +8,8 @@ #include <vespa/searchlib/memoryindex/i_field_index_collection.h> #include <vespa/searchlib/memoryindex/word_store.h> #include <vespa/searchlib/test/memoryindex/ordered_field_index_inserter.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> + #include <vespa/vespalib/gtest/gtest.h> namespace search { @@ -18,6 +19,8 @@ using index::DocBuilder; using index::Schema; using index::schema::CollectionType; using index::schema::DataType; +using vespalib::SequencedTaskExecutor; +using vespalib::ISequencedTaskExecutor; using namespace index; diff --git a/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp b/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp index 7a0c240dea5..ed6bd7168f2 100644 --- a/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp +++ b/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp @@ -1,6 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/searchlib/common/sequencedtaskexecutor.h> #include <vespa/searchlib/diskindex/fusion.h> #include <vespa/searchlib/diskindex/indexbuilder.h> #include <vespa/searchlib/diskindex/zcposoccrandread.h> @@ -19,6 +18,8 @@ #include <vespa/searchlib/test/memoryindex/wrap_inserter.h> #include <vespa/vespalib/btree/btreenodeallocator.hpp> #include <vespa/vespalib/btree/btreeroot.hpp> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> + #include <vespa/vespalib/gtest/gtest.h> #include <vespa/log/log.h> @@ -38,6 +39,9 @@ using search::index::schema::CollectionType; using search::index::schema::DataType; using search::index::test::MockFieldLengthInspector; using vespalib::GenerationHandler; +using vespalib::ISequencedTaskExecutor; +using vespalib::SequencedTaskExecutor; + namespace memoryindex { diff --git a/searchlib/src/tests/memoryindex/memory_index/memory_index_test.cpp b/searchlib/src/tests/memoryindex/memory_index/memory_index_test.cpp index 5032ed2c179..6476ac7cf8a 100644 --- a/searchlib/src/tests/memoryindex/memory_index/memory_index_test.cpp +++ b/searchlib/src/tests/memoryindex/memory_index/memory_index_test.cpp @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/searchlib/common/scheduletaskcallback.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> #include <vespa/searchlib/fef/matchdata.h> #include <vespa/searchlib/fef/matchdatalayout.h> #include <vespa/searchlib/fef/termfieldmatchdata.h> @@ -14,9 +13,10 @@ #include <vespa/searchlib/queryeval/fake_search.h> #include <vespa/searchlib/queryeval/fake_searchable.h> #include <vespa/searchlib/queryeval/searchiterator.h> -#include <vespa/vespalib/gtest/gtest.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/threadstackexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> +#include <vespa/vespalib/gtest/gtest.h> #include <vespa/log/log.h> LOG_SETUP("memory_index_test"); @@ -31,6 +31,8 @@ using vespalib::makeLambdaTask; using search::query::Node; using search::query::SimplePhrase; using search::query::SimpleStringTerm; +using vespalib::ISequencedTaskExecutor; +using vespalib::SequencedTaskExecutor; using namespace search::fef; using namespace search::index; using namespace search::memoryindex; @@ -64,8 +66,8 @@ struct MySetup : public IFieldLengthInspector { struct Index { Schema schema; vespalib::ThreadStackExecutor _executor; - std::unique_ptr<search::ISequencedTaskExecutor> _invertThreads; - std::unique_ptr<search::ISequencedTaskExecutor> _pushThreads; + std::unique_ptr<ISequencedTaskExecutor> _invertThreads; + std::unique_ptr<ISequencedTaskExecutor> _pushThreads; MemoryIndex index; DocBuilder builder; uint32_t docid; @@ -123,8 +125,8 @@ private: Index::Index(const MySetup &setup) : schema(setup.schema), _executor(1, 128 * 1024), - _invertThreads(search::SequencedTaskExecutor::create(2)), - _pushThreads(search::SequencedTaskExecutor::create(2)), + _invertThreads(SequencedTaskExecutor::create(2)), + _pushThreads(SequencedTaskExecutor::create(2)), index(schema, setup, *_invertThreads, *_pushThreads), builder(schema), docid(1), diff --git a/searchlib/src/vespa/searchlib/common/CMakeLists.txt b/searchlib/src/vespa/searchlib/common/CMakeLists.txt index f4a9e27b79d..36264a2035b 100644 --- a/searchlib/src/vespa/searchlib/common/CMakeLists.txt +++ b/searchlib/src/vespa/searchlib/common/CMakeLists.txt @@ -1,7 +1,6 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. vespa_add_library(searchlib_common OBJECT SOURCES - adaptive_sequenced_executor.cpp allocatedbitvector.cpp bitvector.cpp bitvectorcache.cpp @@ -12,11 +11,9 @@ vespa_add_library(searchlib_common OBJECT documentsummary.cpp featureset.cpp fileheadercontext.cpp - foregroundtaskexecutor.cpp gatecallback.cpp growablebitvector.cpp indexmetainfo.cpp - isequencedtaskexecutor.cpp location.cpp locationiterators.cpp mapnames.cpp @@ -24,8 +21,6 @@ vespa_add_library(searchlib_common OBJECT packets.cpp partialbitvector.cpp resultset.cpp - sequencedtaskexecutor.cpp - sequencedtaskexecutorobserver.cpp serialnumfileheadercontext.cpp sort.cpp sortdata.cpp diff --git a/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.cpp b/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.cpp index defb537be0e..4b253387f15 100644 --- a/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.cpp +++ b/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.cpp @@ -1,9 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <cstddef> -#include <cstdint> #include "threaded_compactable_lid_space.h" -#include "isequencedtaskexecutor.h" #include <future> namespace search::common { diff --git a/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.h b/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.h index 02d54acf666..f22d5946295 100644 --- a/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.h +++ b/searchlib/src/vespa/searchlib/common/threaded_compactable_lid_space.h @@ -3,7 +3,7 @@ #pragma once #include "i_compactable_lid_space.h" -#include "isequencedtaskexecutor.h" +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <memory> namespace search::common { @@ -15,6 +15,7 @@ namespace search::common { */ class ThreadedCompactableLidSpace : public ICompactableLidSpace { + using ISequencedTaskExecutor = vespalib::ISequencedTaskExecutor; std::shared_ptr<ICompactableLidSpace> _target; ISequencedTaskExecutor &_executor; ISequencedTaskExecutor::ExecutorId _executorId; diff --git a/searchlib/src/vespa/searchlib/memoryindex/document_inverter.cpp b/searchlib/src/vespa/searchlib/memoryindex/document_inverter.cpp index d032f06fc58..c8b23b2256f 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/document_inverter.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/document_inverter.cpp @@ -8,7 +8,7 @@ #include <vespa/document/annotation/alternatespanlist.h> #include <vespa/document/datatype/urldatatype.h> #include <vespa/document/repo/fixedtyperepo.h> -#include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/searchlib/common/sort.h> #include <vespa/searchlib/util/url.h> #include <vespa/vespalib/text/lowercase.h> diff --git a/searchlib/src/vespa/searchlib/memoryindex/document_inverter.h b/searchlib/src/vespa/searchlib/memoryindex/document_inverter.h index ffa9dd0fab8..57f51e7fdb0 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/document_inverter.h +++ b/searchlib/src/vespa/searchlib/memoryindex/document_inverter.h @@ -6,18 +6,21 @@ #include <vespa/searchlib/index/schema_index_fields.h> namespace document { -class DataType; -class Document; -class DocumentType; -class Field; -class FieldValue; + class DataType; + class Document; + class DocumentType; + class Field; + class FieldValue; } namespace search { - class ISequencedTaskExecutor; class IDestructorCallback; } +namespace vespalib { + class ISequencedTaskExecutor; +} + namespace search::memoryindex { class FieldInverter; @@ -31,6 +34,7 @@ class IFieldIndexCollection; */ class DocumentInverter { private: + using ISequencedTaskExecutor = vespalib::ISequencedTaskExecutor; DocumentInverter(const DocumentInverter &) = delete; DocumentInverter &operator=(const DocumentInverter &) = delete; diff --git a/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp b/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp index d8e48e84fb7..34c5d65ab23 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp @@ -5,7 +5,7 @@ #include "memory_index.h" #include <vespa/document/fieldvalue/arrayfieldvalue.h> #include <vespa/document/fieldvalue/document.h> -#include <vespa/searchlib/common/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/searchlib/index/field_length_calculator.h> #include <vespa/searchlib/index/schemautil.h> #include <vespa/searchlib/queryeval/create_blueprint_visitor_helper.h> @@ -44,6 +44,7 @@ using queryeval::EmptyBlueprint; using queryeval::FieldSpec; using queryeval::IRequestContext; using queryeval::Searchable; +using vespalib::ISequencedTaskExecutor; } diff --git a/searchlib/src/vespa/searchlib/memoryindex/memory_index.h b/searchlib/src/vespa/searchlib/memoryindex/memory_index.h index 4e20bcf81e3..a9f153f7dd8 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/memory_index.h +++ b/searchlib/src/vespa/searchlib/memoryindex/memory_index.h @@ -14,7 +14,7 @@ namespace search::index { class IndexBuilder; } -namespace search { class ISequencedTaskExecutor; } +namespace vespalib { class ISequencedTaskExecutor; } namespace document { class Document; } @@ -40,6 +40,7 @@ class FieldIndexCollection; */ class MemoryIndex : public queryeval::Searchable { private: + using ISequencedTaskExecutor = vespalib::ISequencedTaskExecutor; index::Schema _schema; ISequencedTaskExecutor &_invertThreads; ISequencedTaskExecutor &_pushThreads; diff --git a/staging_vespalib/CMakeLists.txt b/staging_vespalib/CMakeLists.txt index 9fb48cbd4fc..e76d3078630 100644 --- a/staging_vespalib/CMakeLists.txt +++ b/staging_vespalib/CMakeLists.txt @@ -30,6 +30,7 @@ vespa_define_module( src/tests/shutdownguard src/tests/state_server src/tests/stllike + src/tests/sequencedtaskexecutor src/tests/singleexecutor src/tests/timer src/tests/util/process_memory_stats diff --git a/staging_vespalib/src/tests/sequencedtaskexecutor/.gitignore b/staging_vespalib/src/tests/sequencedtaskexecutor/.gitignore new file mode 100644 index 00000000000..523cfe5e3e1 --- /dev/null +++ b/staging_vespalib/src/tests/sequencedtaskexecutor/.gitignore @@ -0,0 +1,4 @@ +staging_vespalib_sequencedtaskexecutor_test_app +staging_vespalib_sequencedtaskexecutor_benchmark_app +staging_vespalib_adaptive_sequenced_executor_test_app +staging_vespalib_foregroundtaskexecutor_test_app diff --git a/staging_vespalib/src/tests/sequencedtaskexecutor/CMakeLists.txt b/staging_vespalib/src/tests/sequencedtaskexecutor/CMakeLists.txt new file mode 100644 index 00000000000..6895eafd94a --- /dev/null +++ b/staging_vespalib/src/tests/sequencedtaskexecutor/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +vespa_add_executable(staging_vespalib_sequencedtaskexecutor_benchmark_app TEST + SOURCES + sequencedtaskexecutor_benchmark.cpp + DEPENDS + staging_vespalib +) + +vespa_add_executable(staging_vespalib_sequencedtaskexecutor_test_app TEST + SOURCES + sequencedtaskexecutor_test.cpp + DEPENDS + staging_vespalib +) +vespa_add_test(NAME staging_vespalib_sequencedtaskexecutor_test_app COMMAND staging_vespalib_sequencedtaskexecutor_test_app) + +vespa_add_executable(staging_vespalib_adaptive_sequenced_executor_test_app TEST + SOURCES + adaptive_sequenced_executor_test.cpp + DEPENDS + staging_vespalib +) +vespa_add_test(NAME staging_vespalib_adaptive_sequenced_executor_test_app COMMAND staging_vespalib_adaptive_sequenced_executor_test_app) + +vespa_add_executable(staging_vespalib_foregroundtaskexecutor_test_app TEST + SOURCES + foregroundtaskexecutor_test.cpp + DEPENDS + staging_vespalib +) +vespa_add_test(NAME staging_vespalib_foregroundtaskexecutor_test_app COMMAND staging_vespalib_foregroundtaskexecutor_test_app) diff --git a/searchlib/src/tests/common/sequencedtaskexecutor/adaptive_sequenced_executor_test.cpp b/staging_vespalib/src/tests/sequencedtaskexecutor/adaptive_sequenced_executor_test.cpp index ba66b28108c..10f3f6089e3 100644 --- a/searchlib/src/tests/common/sequencedtaskexecutor/adaptive_sequenced_executor_test.cpp +++ b/staging_vespalib/src/tests/sequencedtaskexecutor/adaptive_sequenced_executor_test.cpp @@ -1,17 +1,16 @@ // Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/searchlib/common/adaptive_sequenced_executor.h> +#include <vespa/vespalib/util/adaptive_sequenced_executor.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/test/insertion_operators.h> -#include <mutex> #include <condition_variable> #include <unistd.h> #include <vespa/log/log.h> LOG_SETUP("adaptive_sequenced_executor_test"); -namespace search::common { +namespace vespalib { class Fixture diff --git a/searchlib/src/tests/common/foregroundtaskexecutor/foregroundtaskexecutor_test.cpp b/staging_vespalib/src/tests/sequencedtaskexecutor/foregroundtaskexecutor_test.cpp index 0cbd4bd9473..a2671bb81a7 100644 --- a/searchlib/src/tests/common/foregroundtaskexecutor/foregroundtaskexecutor_test.cpp +++ b/staging_vespalib/src/tests/sequencedtaskexecutor/foregroundtaskexecutor_test.cpp @@ -1,16 +1,15 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/searchlib/common/foregroundtaskexecutor.h> +#include <vespa/vespalib/util/foregroundtaskexecutor.h> #include <vespa/vespalib/testkit/testapp.h> -#include <mutex> #include <condition_variable> #include <unistd.h> #include <vespa/log/log.h> LOG_SETUP("foregroundtaskexecutor_test"); -namespace search::common { +namespace vespalib { class Fixture diff --git a/searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_benchmark.cpp b/staging_vespalib/src/tests/sequencedtaskexecutor/sequencedtaskexecutor_benchmark.cpp index 362dc28d36a..042408d439f 100644 --- a/searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_benchmark.cpp +++ b/staging_vespalib/src/tests/sequencedtaskexecutor/sequencedtaskexecutor_benchmark.cpp @@ -1,15 +1,15 @@ // Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/searchlib/common/sequencedtaskexecutor.h> -#include <vespa/searchlib/common/adaptive_sequenced_executor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/adaptive_sequenced_executor.h> #include <vespa/vespalib/util/lambdatask.h> #include <vespa/vespalib/util/time.h> #include <atomic> -using search::ISequencedTaskExecutor; -using search::SequencedTaskExecutor; -using search::AdaptiveSequencedExecutor; -using ExecutorId = search::ISequencedTaskExecutor::ExecutorId; +using vespalib::ISequencedTaskExecutor; +using vespalib::SequencedTaskExecutor; +using vespalib::AdaptiveSequencedExecutor; +using ExecutorId = vespalib::ISequencedTaskExecutor::ExecutorId; size_t do_work(size_t size) { size_t ret = 0; diff --git a/searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp b/staging_vespalib/src/tests/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp index c311a59a56c..f5f04738e92 100644 --- a/searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp +++ b/staging_vespalib/src/tests/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp @@ -1,17 +1,16 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/searchlib/common/sequencedtaskexecutor.h> +#include <vespa/vespalib/util/sequencedtaskexecutor.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/test/insertion_operators.h> -#include <mutex> #include <condition_variable> #include <unistd.h> #include <vespa/log/log.h> LOG_SETUP("sequencedtaskexecutor_test"); -namespace search::common { +namespace vespalib { class Fixture diff --git a/staging_vespalib/src/vespa/vespalib/util/CMakeLists.txt b/staging_vespalib/src/vespa/vespalib/util/CMakeLists.txt index ba03b77c941..586e06396e7 100644 --- a/staging_vespalib/src/vespa/vespalib/util/CMakeLists.txt +++ b/staging_vespalib/src/vespa/vespalib/util/CMakeLists.txt @@ -1,11 +1,14 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. vespa_add_library(staging_vespalib_vespalib_util OBJECT SOURCES + adaptive_sequenced_executor.cpp bits.cpp clock.cpp crc.cpp doom.cpp + foregroundtaskexecutor.cpp growablebytebuffer.cpp + isequencedtaskexecutor.cpp jsonexception.cpp jsonstream.cpp jsonwriter.cpp @@ -15,6 +18,8 @@ vespa_add_library(staging_vespalib_vespalib_util OBJECT programoptions_testutils.cpp document_runnable.cpp rusage.cpp + sequencedtaskexecutor.cpp + sequencedtaskexecutorobserver.cpp shutdownguard.cpp scheduledexecutor.cpp singleexecutor.cpp diff --git a/searchlib/src/vespa/searchlib/common/adaptive_sequenced_executor.cpp b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp index f31172b1eba..50bc3b020a8 100644 --- a/searchlib/src/vespa/searchlib/common/adaptive_sequenced_executor.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.cpp @@ -2,7 +2,7 @@ #include "adaptive_sequenced_executor.h" -namespace search { +namespace vespalib { //----------------------------------------------------------------------------- diff --git a/searchlib/src/vespa/searchlib/common/adaptive_sequenced_executor.h b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.h index 3abc095e9df..bc3457a72ef 100644 --- a/searchlib/src/vespa/searchlib/common/adaptive_sequenced_executor.h +++ b/staging_vespalib/src/vespa/vespalib/util/adaptive_sequenced_executor.h @@ -10,7 +10,7 @@ #include <condition_variable> #include <cassert> -namespace search { +namespace vespalib { /** * Sequenced executor that balances the number of active threads in diff --git a/searchlib/src/vespa/searchlib/common/foregroundtaskexecutor.cpp b/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.cpp index a93eb1ff4bc..b45ada1c58c 100644 --- a/searchlib/src/vespa/searchlib/common/foregroundtaskexecutor.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.cpp @@ -1,12 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "foregroundtaskexecutor.h" -#include <vespa/vespalib/util/threadstackexecutor.h> -#include <vespa/vespalib/stllike/hash_map.hpp> +#include <cassert> -using vespalib::ThreadStackExecutor; - -namespace search { +namespace vespalib { ForegroundTaskExecutor::ForegroundTaskExecutor() : ForegroundTaskExecutor(1) diff --git a/searchlib/src/vespa/searchlib/common/foregroundtaskexecutor.h b/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.h index 0b604fb140d..d9a348ed012 100644 --- a/searchlib/src/vespa/searchlib/common/foregroundtaskexecutor.h +++ b/staging_vespalib/src/vespa/vespalib/util/foregroundtaskexecutor.h @@ -4,9 +4,7 @@ #include "isequencedtaskexecutor.h" #include <atomic> -namespace vespalib { class ThreadStackExecutorBase; } - -namespace search { +namespace vespalib { /** * Class to run multiple tasks in parallel, but tasks with same diff --git a/searchlib/src/vespa/searchlib/common/isequencedtaskexecutor.cpp b/staging_vespalib/src/vespa/vespalib/util/isequencedtaskexecutor.cpp index 9d1bc99bebb..d05702cc85b 100644 --- a/searchlib/src/vespa/searchlib/common/isequencedtaskexecutor.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/isequencedtaskexecutor.cpp @@ -5,10 +5,11 @@ #include <vespa/vespalib/stllike/hashtable.h> #include <cassert> -namespace search { - namespace { - constexpr uint8_t MAGIC = 255; - } +namespace vespalib { + +namespace { + constexpr uint8_t MAGIC = 255; +} ISequencedTaskExecutor::ISequencedTaskExecutor(uint32_t numExecutors) : _component2Id(vespalib::hashtable_base::getModuloStl(numExecutors*8), MAGIC), diff --git a/searchlib/src/vespa/searchlib/common/isequencedtaskexecutor.h b/staging_vespalib/src/vespa/vespalib/util/isequencedtaskexecutor.h index 55c26abc3d8..cd2a6c6f0d8 100644 --- a/searchlib/src/vespa/searchlib/common/isequencedtaskexecutor.h +++ b/staging_vespalib/src/vespa/vespalib/util/isequencedtaskexecutor.h @@ -8,7 +8,7 @@ #include <vector> #include <mutex> -namespace search { +namespace vespalib { /** * Interface class to run multiple tasks in parallel, but tasks with same @@ -110,4 +110,4 @@ private: mutable uint32_t _nextId; }; -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.cpp b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.cpp index c9b4af6cb55..aa43bfaae7d 100644 --- a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.cpp @@ -1,13 +1,10 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "sequencedtaskexecutor.h" +#include "singleexecutor.h" #include <vespa/vespalib/util/blockingthreadstackexecutor.h> -#include <vespa/vespalib/util/singleexecutor.h> -using vespalib::BlockingThreadStackExecutor; -using vespalib::SingleExecutor; - -namespace search { +namespace vespalib { namespace { diff --git a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.h b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.h index 8568901006f..14127970403 100644 --- a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.h +++ b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutor.h @@ -2,14 +2,10 @@ #pragma once #include "isequencedtaskexecutor.h" -#include <vector> namespace vespalib { - struct ExecutorStats; - class SyncableThreadExecutor; -} -namespace search { +class SyncableThreadExecutor; /** * Class to run multiple tasks in parallel, but tasks with same diff --git a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutorobserver.cpp b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.cpp index e553e757c37..3d9ed4e21f4 100644 --- a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutorobserver.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.cpp @@ -2,7 +2,7 @@ #include "sequencedtaskexecutorobserver.h" -namespace search { +namespace vespalib { SequencedTaskExecutorObserver::SequencedTaskExecutorObserver(ISequencedTaskExecutor &executor) : ISequencedTaskExecutor(executor.getNumExecutors()), diff --git a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutorobserver.h b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.h index dadd4bf59cf..9307a7ddb37 100644 --- a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutorobserver.h +++ b/staging_vespalib/src/vespa/vespalib/util/sequencedtaskexecutorobserver.h @@ -4,7 +4,7 @@ #include "isequencedtaskexecutor.h" #include <atomic> -namespace search { +namespace vespalib { /** * Observer class to observe class to run multiple tasks in parallel, |