aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec_factory.h
blob: c410c0e570166a2e776494f09dc51cb8ec768532 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/searchcore/proton/common/alloc_strategy.h>
#include <vespa/searchlib/common/serialnum.h>
#include <memory>
#include <optional>

namespace vespa::config::search::internal { class InternalAttributesType; };

namespace proton {

class AttributeCollectionSpec;

/**
 * A factory for generating an AttributeCollectionSpec based on AttributesConfig
 * from the config server.
 */
class AttributeCollectionSpecFactory
{
private:
    using AttributesConfig = const vespa::config::search::internal::InternalAttributesType;

    const AllocStrategy        _alloc_strategy;
    const bool                 _fastAccessOnly;

public:
    AttributeCollectionSpecFactory(const AllocStrategy& alloc_strategy, bool fastAccessOnly);
    ~AttributeCollectionSpecFactory();

    std::unique_ptr<AttributeCollectionSpec> create(const AttributesConfig &attrCfg, uint32_t docIdLimit, std::optional<search::SerialNum> serialNum) const;
};

} // namespace proton