aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcorespi/index/indexmaintainerconfig.h
blob: 3f890e6fa76848c007c1b4c2155a66e39d56f732 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "warmupconfig.h"
#include <vespa/searchlib/common/tunefileinfo.h>
#include <vespa/searchlib/common/serialnum.h>
#include <vespa/searchcommon/common/schema.h>
#include <vespa/vespalib/stllike/string.h>

namespace searchcorespi::index {

/**
 * Class that keeps the config used when constructing an index maintainer.
 */
class IndexMaintainerConfig {
private:
    const vespalib::string _baseDir;
    const WarmupConfig _warmup;
    const size_t _maxFlushed;
    const search::index::Schema _schema;
    const search::SerialNum _serialNum;
    const search::TuneFileAttributes _tuneFileAttributes;

public:
    IndexMaintainerConfig(const vespalib::string &baseDir,
                          const WarmupConfig & warmup,
                          size_t maxFlushed,
                          const search::index::Schema &schema,
                          const search::SerialNum serialNum,
                          const search::TuneFileAttributes &tuneFileAttributes);

    ~IndexMaintainerConfig();

    /**
     * Returns the base directory in which the maintainer will store its indexes.
     */
    const vespalib::string &getBaseDir() const {
        return _baseDir;
    }

    WarmupConfig getWarmup() const { return _warmup; }

    /**
     * Returns the initial schema containing all current index fields.
     */
    const search::index::Schema &getSchema() const {
        return _schema;
    }

    search::SerialNum getSerialNum() const { return _serialNum; }

    /**
     * Returns the specification on how to read/write attribute vector data files.
     */
    const search::TuneFileAttributes &getTuneFileAttributes() const {
        return _tuneFileAttributes;
    }

    size_t getMaxFlushed() const {
        return _maxFlushed;
    }
};

}