aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/documentdbconfigscout.cpp
blob: 39e3627999a7c1e967bbc34e5d010b71c9660bcd (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "documentdbconfigscout.h"
#include "documentdbconfig.h"
#include <vespa/searchcore/proton/attribute/attributesconfigscout.h>

using vespa::config::search::AttributesConfig;

namespace proton {

std::shared_ptr<DocumentDBConfig>
DocumentDBConfigScout::scout(const std::shared_ptr<DocumentDBConfig> &config,
                             const DocumentDBConfig &liveConfig)
{
    AttributesConfigScout acScout(liveConfig.getAttributesConfig());
    std::shared_ptr<AttributesConfig> ac(acScout.adjust(config->getAttributesConfig()));
    if (*ac == config->getAttributesConfig())
        return config; // no change
    return config->newFromAttributesConfig(ac);
}


} // namespace proton