summaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h
blob: 2237aed406c7bc40efad3219f0ac2ec80e0b8127 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/config-stor-distribution.h>
#include <memory>

namespace storage::lib { class Distribution; }
namespace storage {

struct GlobalBucketSpaceDistributionConverter {
    using DistributionConfig = vespa::config::content::StorDistributionConfig;
    // TODO remove legacy_mode flags on Vespa 8 - this is a workaround for https://github.com/vespa-engine/vespa/issues/8475
    static std::shared_ptr<DistributionConfig> convert_to_global(const DistributionConfig&, bool legacy_mode = false);
    static std::shared_ptr<lib::Distribution>  convert_to_global(const lib::Distribution&, bool legacy_mode = false);

    // Helper functions which may be of use outside this class
    static std::unique_ptr<DistributionConfig> string_to_config(const vespalib::string&);
    static vespalib::string config_to_string(const DistributionConfig&);
};

}