aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/bmcluster/i_bm_distribution.h
blob: 36c5b6e34ff2a726346af7c8baa6aae4e02672cf (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <cstdint>

namespace document { class Bucket; }

namespace vespa::config::content::internal {
    class InternalStorDistributionType;
}

namespace storage::lib { class ClusterStateBundle; }

namespace search::bmcluster {

/*
 * Interface class for describing cluster toplogy and how messages are
 * routed from feeders into the cluster.
 */
class IBmDistribution {
public:
    using DistributionConfigBuilder = vespa::config::content::internal::InternalStorDistributionType;
    using DistributionConfig = const DistributionConfigBuilder;

    virtual ~IBmDistribution() = default;
    virtual uint32_t get_num_nodes() const = 0;
    virtual uint32_t get_service_layer_node_idx(const document::Bucket & bucket) const = 0;
    virtual uint32_t get_distributor_node_idx(const document::Bucket & bucket) const = 0;
    virtual DistributionConfig get_distribution_config() const = 0;
    virtual storage::lib::ClusterStateBundle get_cluster_state_bundle() const = 0;
};

};