summaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/common/content_bucket_space.cpp
blob: 2bae118e364065fbcd486e91e26d25e3715bf2c9 (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
39
40
41
42
43
44
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "content_bucket_space.h"

namespace storage {

ContentBucketSpace::ContentBucketSpace(document::BucketSpace bucketSpace)
    : _bucketSpace(bucketSpace),
      _bucketDatabase(),
      _lock(),
      _clusterState(),
      _distribution()
{
}

void
ContentBucketSpace::setClusterState(std::shared_ptr<const lib::ClusterState> clusterState)
{
    std::lock_guard guard(_lock);
    _clusterState = std::move(clusterState);
}

std::shared_ptr<const lib::ClusterState>
ContentBucketSpace::getClusterState() const
{
    std::lock_guard guard(_lock);
    return _clusterState;
}

void
ContentBucketSpace::setDistribution(std::shared_ptr<const lib::Distribution> distribution)
{
    std::lock_guard guard(_lock);
    _distribution = std::move(distribution);
}

std::shared_ptr<const lib::Distribution>
ContentBucketSpace::getDistribution() const
{
    std::lock_guard guard(_lock);
    return _distribution;
}

}