// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include #include #include #include #include namespace document { class DocumentTypeRepo; } namespace search::index { class Schema; } namespace proton { class AttributeCollectionSpecFactory; class DocumentDBConfig; class DocumentSubDBReconfig; class FastAccessFeedView; class IAttributeWriter; struct IReprocessingInitializer; class ReconfigParams; /** * Class used to reconfig the feed view used in a fast-access sub database * when the set of fast-access attributes change. */ class FastAccessDocSubDBConfigurer { public: using FeedViewVarHolder = vespalib::VarHolder>; private: FeedViewVarHolder &_feedView; vespalib::string _subDbName; void reconfigureFeedView(FastAccessFeedView & curr, std::shared_ptr schema, std::shared_ptr repo, std::shared_ptr attrWriter); public: FastAccessDocSubDBConfigurer(FeedViewVarHolder &feedView, const vespalib::string &subDbName); ~FastAccessDocSubDBConfigurer(); std::unique_ptr prepare_reconfig(const DocumentDBConfig& new_config_snapshot, const AttributeCollectionSpecFactory& attr_spec_factory, const ReconfigParams& reconfig_params, uint32_t docid_limit, std::optional serial_num); std::unique_ptr reconfigure(const DocumentDBConfig &newConfig, const DocumentDBConfig &oldConfig, const DocumentSubDBReconfig& prepared_reconfig, search::SerialNum serial_num); }; } // namespace proton