aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/distributor/distributor_component.cpp
blob: e01d7e7cb6dec8c7553357fa41927a36dd1e4133 (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
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "distributor_bucket_space.h"
#include "distributor_bucket_space_repo.h"
#include "distributor_component.h"

namespace storage::distributor {

DistributorComponent::DistributorComponent(DistributorInterface& distributor,
                                           DistributorComponentRegister& comp_reg,
                                           const std::string& name)
    : storage::DistributorComponent(comp_reg, name),
      _distributor(distributor),
      _bucket_space_repo(std::make_unique<DistributorBucketSpaceRepo>(node_index(), false)),
      _read_only_bucket_space_repo(std::make_unique<DistributorBucketSpaceRepo>(node_index(), false))
{
}

DistributorComponent::~DistributorComponent() = default;

api::StorageMessageAddress
DistributorComponent::node_address(uint16_t node_index) const noexcept
{
    return api::StorageMessageAddress::create(cluster_name_ptr(), lib::NodeType::STORAGE, node_index);
}

}