aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/proton_config_snapshot.h
blob: 0ef8a79bdbe233b3e6fc0b22e103d1066ca3a898 (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
// 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/doctypename.h>
#include <map>
#include <memory>

namespace proton {

class BootstrapConfig;
class DocumentDBConfig;

/*
 * Class representing a config snapshot accross all document dbs as well as
 * the matching bootstrap config.
 */
class ProtonConfigSnapshot
{
    using DocumentDBConfigs = std::map<DocTypeName, std::shared_ptr<DocumentDBConfig>>;
    std::shared_ptr<BootstrapConfig> _bootstrapConfig;
    DocumentDBConfigs _documentDBConfigs;

public:
    ProtonConfigSnapshot(std::shared_ptr<BootstrapConfig> bootstrapConfig,
                         DocumentDBConfigs documentDBConfigs);
    ~ProtonConfigSnapshot();
    const std::shared_ptr<BootstrapConfig> getBootstrapConfig() const { return _bootstrapConfig; }
    const DocumentDBConfigs &getDocumentDBConfigs() const { return _documentDBConfigs; }
};

} // namespace proton