aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/documentdbconfigscout.cpp
blob: f7df7086316562d6820c48868d6fb701e7dc8f90 (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 Yahoo. 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