diff options
author | Tor Egge <Tor.Egge@oath.com> | 2018-02-01 11:18:58 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2018-02-01 11:18:58 +0000 |
commit | 6f85d69a99e36bb88666590b3f220210aded6c17 (patch) | |
tree | 724069f8dfdcaeb8cb0bbb94985f04ce5872f937 /storage | |
parent | e5b308f018266f6d4a87d14fae8973c4da5e7bdb (diff) |
Reduce use of document::BucketSpace::placeHolder().
Diffstat (limited to 'storage')
5 files changed, 6 insertions, 28 deletions
diff --git a/storage/src/tests/distributor/distributortestutil.cpp b/storage/src/tests/distributor/distributortestutil.cpp index 6f5abc02512..fedd836513b 100644 --- a/storage/src/tests/distributor/distributortestutil.cpp +++ b/storage/src/tests/distributor/distributortestutil.cpp @@ -5,7 +5,9 @@ #include <vespa/config-stor-distribution.h> #include <vespa/vespalib/text/stringtokenizer.h> #include <vespa/document/test/make_document_bucket.h> +#include <vespa/document/test/make_bucket_space.h> +using document::test::makeBucketSpace; using document::test::makeDocumentBucket; namespace storage::distributor { @@ -347,16 +349,16 @@ DistributorTestUtil::getConfig() { DistributorBucketSpace & DistributorTestUtil::getDistributorBucketSpace() { - return _distributor->getDefaultBucketSpace(); + return getBucketSpaceRepo().get(makeBucketSpace()); } BucketDatabase& DistributorTestUtil::getBucketDatabase() { - return _distributor->getDefaultBucketSpace().getBucketDatabase(); + return getDistributorBucketSpace().getBucketDatabase(); } const BucketDatabase& DistributorTestUtil::getBucketDatabase() const { - return _distributor->getDefaultBucketSpace().getBucketDatabase(); + return getBucketSpaceRepo().get(makeBucketSpace()).getBucketDatabase(); } DistributorBucketSpaceRepo & @@ -371,7 +373,7 @@ DistributorTestUtil::getBucketSpaceRepo() const { const lib::Distribution& DistributorTestUtil::getDistribution() const { - return _distributor->getDefaultBucketSpace().getDistribution(); + return getBucketSpaceRepo().get(makeBucketSpace()).getDistribution(); } } diff --git a/storage/src/vespa/storage/distributor/distributor.cpp b/storage/src/vespa/storage/distributor/distributor.cpp index 82d0c873cb6..68f43b04e74 100644 --- a/storage/src/vespa/storage/distributor/distributor.cpp +++ b/storage/src/vespa/storage/distributor/distributor.cpp @@ -132,14 +132,6 @@ Distributor::getPendingMessageTracker() const return _pendingMessageTracker; } -DistributorBucketSpace& Distributor::getDefaultBucketSpace() noexcept { - return _bucketSpaceRepo->getDefaultSpace(); -} - -const DistributorBucketSpace& Distributor::getDefaultBucketSpace() const noexcept { - return _bucketSpaceRepo->getDefaultSpace(); -} - BucketOwnership Distributor::checkOwnershipInPendingState(const document::Bucket &b) const { diff --git a/storage/src/vespa/storage/distributor/distributor.h b/storage/src/vespa/storage/distributor/distributor.h index 9406dacf358..39695b26415 100644 --- a/storage/src/vespa/storage/distributor/distributor.h +++ b/storage/src/vespa/storage/distributor/distributor.h @@ -156,8 +156,6 @@ public: return *_bucketIdHasher; } - DistributorBucketSpace& getDefaultBucketSpace() noexcept; - const DistributorBucketSpace& getDefaultBucketSpace() const noexcept; DistributorBucketSpaceRepo &getBucketSpaceRepo() noexcept { return *_bucketSpaceRepo; } const DistributorBucketSpaceRepo &getBucketSpaceRepo() const noexcept { return *_bucketSpaceRepo; } 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 aad3bee8b32..b72fe17af66 100644 --- a/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp +++ b/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.cpp @@ -47,17 +47,5 @@ DistributorBucketSpaceRepo::get(BucketSpace bucketSpace) const return *itr->second; } -DistributorBucketSpace & -DistributorBucketSpaceRepo::getDefaultSpace() noexcept -{ - return get(BucketSpace::placeHolder()); -} - -const DistributorBucketSpace & -DistributorBucketSpaceRepo::getDefaultSpace() const noexcept -{ - return get(BucketSpace::placeHolder()); -} - } } 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 4418aa4a2d6..7d7db240ad9 100644 --- a/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.h +++ b/storage/src/vespa/storage/distributor/distributor_bucket_space_repo.h @@ -29,8 +29,6 @@ public: DistributorBucketSpaceRepo(DistributorBucketSpaceRepo&&) = delete; DistributorBucketSpaceRepo& operator=(DistributorBucketSpaceRepo&&) = delete; - DistributorBucketSpace& getDefaultSpace() noexcept; - const DistributorBucketSpace& getDefaultSpace() const noexcept; DistributorBucketSpace &get(document::BucketSpace bucketSpace); const DistributorBucketSpace &get(document::BucketSpace bucketSpace) const; |