aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/distributor/simpleclusterinformation.h
blob: fb0313637ed275156cc75b3baf76b9c45116127f (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
35
36
37
38
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "clusterinformation.h"
#include <vespa/vdslib/state/cluster_state_bundle.h>

namespace storage::distributor {

class SimpleClusterInformation : public ClusterInformation
{
public:
    SimpleClusterInformation(uint16_t myIndex,
                             const lib::ClusterStateBundle& clusterStateBundle,
                             const char* storageUpStates)
        : _myIndex(myIndex),
          _clusterStateBundle(clusterStateBundle),
          _storageUpStates(storageUpStates)
    {}

    uint16_t getDistributorIndex() const override {
        return _myIndex;
    }

    const lib::ClusterStateBundle& getClusterStateBundle() const override {
        return _clusterStateBundle;
    }

    const char* getStorageUpStates() const override {
        return _storageUpStates;
    }

private:
    uint16_t _myIndex;
    lib::ClusterStateBundle _clusterStateBundle;
    const char* _storageUpStates;
};

}