aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/common/node_identity.h
blob: 77399f78d0c245a995c32673e0ef4177820fd94f (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vdslib/state/nodetype.h>
#include <vespa/vespalib/stllike/string.h>

namespace storage {

/**
 * Class that represents the identity of a storage or distributor node.
 */
class NodeIdentity {
private:
    vespalib::string _cluster_name;
    const lib::NodeType& _node_type;
    uint16_t _node_index;

public:
    NodeIdentity(vespalib::stringref cluster_name_in,
                 const lib::NodeType& node_type_in,
                 uint16_t node_index_in);
    const vespalib::string& cluster_name() const { return _cluster_name; }
    const lib::NodeType& node_type() const { return _node_type; }
    uint16_t node_index() const { return _node_index; }
};

}