diff options
author | Geir Storli <geirstorli@yahoo.no> | 2017-11-21 12:41:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-21 12:41:00 +0100 |
commit | 83b8ab009cddbe8aea19488059580556ed8c08a3 (patch) | |
tree | eb5ed98608f758434f0c959c49ad06f815635f9b /storage | |
parent | 1ebd59a62edca6be20d3f0650cf44227d1148beb (diff) | |
parent | c20f8795ef33e5e7278ee07b27a097375ac7f718 (diff) |
Merge pull request #4212 from vespa-engine/toregge/use-shared-pointer-to-const-distribution-in-distributor-bucket-space
Use shared pointer to const Distribution in DistributorBucketSpace.
Diffstat (limited to 'storage')
5 files changed, 6 insertions, 6 deletions
diff --git a/storage/src/vespa/storage/distributor/distributor.cpp b/storage/src/vespa/storage/distributor/distributor.cpp index e0995e3e17a..58e14d654d2 100644 --- a/storage/src/vespa/storage/distributor/distributor.cpp +++ b/storage/src/vespa/storage/distributor/distributor.cpp @@ -547,7 +547,7 @@ Distributor::enableNextDistribution() void Distributor::propagateDefaultDistribution( - std::shared_ptr<lib::Distribution> distribution) + std::shared_ptr<const lib::Distribution> distribution) { _bucketSpaceRepo->setDefaultDistribution(std::move(distribution)); } diff --git a/storage/src/vespa/storage/distributor/distributor.h b/storage/src/vespa/storage/distributor/distributor.h index f8a1d438134..9406dacf358 100644 --- a/storage/src/vespa/storage/distributor/distributor.h +++ b/storage/src/vespa/storage/distributor/distributor.h @@ -231,7 +231,7 @@ private: Operation::SP& operation); void enableNextDistribution(); - void propagateDefaultDistribution(std::shared_ptr<lib::Distribution>); + void propagateDefaultDistribution(std::shared_ptr<const lib::Distribution>); lib::ClusterState _clusterState; diff --git a/storage/src/vespa/storage/distributor/distributor_bucket_space.h b/storage/src/vespa/storage/distributor/distributor_bucket_space.h index 17be92126cb..30893e8cfb1 100644 --- a/storage/src/vespa/storage/distributor/distributor_bucket_space.h +++ b/storage/src/vespa/storage/distributor/distributor_bucket_space.h @@ -26,7 +26,7 @@ namespace distributor { */ class DistributorBucketSpace { MapBucketDatabase _bucketDatabase; - std::shared_ptr<lib::Distribution> _distribution; + std::shared_ptr<const lib::Distribution> _distribution; public: DistributorBucketSpace(); ~DistributorBucketSpace(); @@ -43,7 +43,7 @@ public: return _bucketDatabase; } - void setDistribution(lib::Distribution::SP distribution) { + void setDistribution(std::shared_ptr<const lib::Distribution> distribution) { _distribution = std::move(distribution); } diff --git a/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp b/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp index ddf28b3d95d..d414f520bc2 100644 --- a/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp +++ b/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp @@ -29,7 +29,7 @@ DistributorBucketSpaceRepo::add(document::BucketSpace bucketSpace, std::unique_p } void DistributorBucketSpaceRepo::setDefaultDistribution( - std::shared_ptr<lib::Distribution> distr) + std::shared_ptr<const lib::Distribution> distr) { LOG(debug, "Got new default distribution '%s'", distr->toString().c_str()); // TODO all spaces, per-space config transforms diff --git a/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.h b/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.h index b0f367e8be5..c3661b53e69 100644 --- a/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.h +++ b/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.h @@ -34,7 +34,7 @@ public: DistributorBucketSpace &get(document::BucketSpace bucketSpace); const DistributorBucketSpace &get(document::BucketSpace bucketSpace) const; - void setDefaultDistribution(std::shared_ptr<lib::Distribution> distr); + void setDefaultDistribution(std::shared_ptr<const lib::Distribution> distr); BucketSpaceMap::const_iterator begin() const { return _map.begin(); } BucketSpaceMap::const_iterator end() const { return _map.end(); } void add(document::BucketSpace bucketSpace, std::unique_ptr<DistributorBucketSpace> distributorBucketSpace); |